This repo is prepared so that the Kuzgunlar Turkish NLP models can be easily used by the end users.
- Python3.4 or higher version.
- The Python Package Installer (pip).
- Clone or download this repo
- Then use the following command to install the packages named in the requirements.txt file.
python3 -m pip install -r requirements.txt
❗ IMPORTANT - Each model is ~ 450mb in size and will be downloaded automatically during initial startup. Therefore, the first run may take a long time.
- Installation process:
The web interface provides a very easy to use environment for the end users to test and use the models.
- To run the interface, all you have to do is running this command.
python3 dash_app.py
-
Then you can use the Q&A and NER models by going to http://127.0.0.1:8050 with your browser.
-
The Kuzgunlar web interface allows you to try all other models available at https://huggingface.co/models.
-
Usage:
The web API is useful when you need to work fast with big data.
- To run the interface, all you have to do is running this command.
python3 api.py
- Next, you need to post a POST request to the URL of the model you want to use.
- If you use curl for REST request:
For NER Model:
curl http://127.0.0.1:5000/ner -H 'Content-Type: application/json' -d '{"context": "Samsun, büyükşehir statüsündeki otuz ilden biridir."}'
For the Question-Answer Model:
curl http://127.0.0.1:5000/qa -H 'Content-Type: application/json' -d '{"context": "Mehteran birliği 1365 yılında kuruldu.", "question": "Mehteran ne zaman kuruldu?"}'
For Sentiment Analysis Model:
curl http://127.0.0.1:5000/sentiment -H 'Content-Type: application/json' -d '{"context": "Bu ürün çok başarılı."}'
- Usage: