A simple web app that allows the user to enter an Arabic word and retrieve stem predictions from three of NLTK's Arabic stemming algorithms.
This was created as a learning project to learn more about python stemming algorithms for the Arabic language, to experiment with SvelteKit, especially its API functionality, and to explore Node child processes.
Enter an Arabic word in the prompt. Submitting the request will prompt three of NLTK's Arabic stemming algorithms and deliver the response back in table form to the user.
The user can enter words in two ways:
The application simply takes the form entry, calls the python script, and returns the result to the user.
To do this, the web app was scaffolded using SvelteKit.
In this example, Node spawns a child process to call the python script with NLTK via an API. It takes the form entry as input and returns the predicted stems as output in JSON format. In this way, the script is coupled with the app for a convenient example, but it can also be easily decoupled and hosted elsewhere for standard API function calls.
In its current basic form, there are a few steps required to get the app up and running.
git clone [email protected]:Wollaston/ArabicStemmer.git //using ssh
python3 -m venv venv
pip install nltk
npm install
npm run dev //will provide a link to the proper port
During experimentation, it became clear that the existing Arabic stemming algorithms from NLTK are not entirely perfect, especially when trying to accurately identify word roots, although they are generally accurate with standard vocabulary.
Therefore, the algorithm provides three predictions to give the user some choice when assessing the accuracy of the responses.
These algorithms are: