import requests
# Get result in XML format
url = "http://oujda-nlp-team.net:8083/api/parser"
text_input = "##############################"
data = {"textinput": text_input}
response = requests.post(url, data=data)
if response.status_code == 200:
result = response.text
print(f"Result in text format: {result}")
else:
print("Error during API request.")
This parser identifies the syntactic constituents of a sentence and specifies the dependencies between them without going through a learning phase. It combines notions of linguistic formalisms with rules introduced by ancient Arabic grammarians such as the nature of sentences, the nature of dependencies and the number of main phrases in a sentence. Using Arabic grammar allows for better selection of phrases and dependencies and therefore gains complexity. The results of the evaluation show the relevance of the approach adopted.
For further details, please check the following paper :
- Ababou, N., Mazroui, A. & Belehbib, R. From extended chunking to dependency parsing using traditional Arabic grammar. Lang Resources & Evaluation 57, 1011–1043 (2023). https://doi.org/10.1007/s10579-022-09629-w
- Ababou, N., Mazroui, A., & Belehbib, R. (2017). Parsing Arabic Nominal sentences using context free grammar and fundamental rules of classical grammar. International Journal of Intelligent Systems and Applications, 9(8), 11.

