A fast API for sentiment analysis, lemmatization, POS tagging, chunking, and named entity recognition using FastAPI, spaCy, and TextBlob.
-
Install dependencies:
pip install -r requirements.txt python -m textblob.download_corpora python -m spacy download en_core_web_sm
-
Run the API server:
uvicorn main:app --reload
POST /sentiment— Sentiment analysisPOST /lemmatize— Lemmatization (stemming)POST /pos_chunk— POS tagging and chunkingPOST /phrase_ner— Phrase extraction and NER
Request body:
{
"text": "Your text here."
}Request:
{
"text": "Bonjour tout le monde!"
}Response:
{
"language": "fr"
}Request:
{
"text": "Hello, world!"
}Response:
{
"tokens": ["Hello", ",", "world", "!"]
}