FastAPI-based service designed to provide real-time text analysis. It leverages some Natural Language Processing (NLP) libraries to offer functionalities such as sentiment analysis, keyword extraction, and text summarization.
APACHE-2.0 License
NLPower
NLPower is a FastAPI-based service designed to provide real-time text analysis. It leverages some Natural Language Processing (NLP) libraries to offer functionalities such as sentiment analysis, keyword extraction, and text summarization.
This API can be used as a standalone service or integrated into front-end applications, data analytics tools, or any system that requires automated text understanding.
Make sure you have Python 3.8+ installed on your machine. It is also recommended to use a virtual environment for Python projects.
Clone the repository
git clone https://github.com/yourusername/nlpower.git
cd nlpower
Install required Python packages
pip3 install -r requirements.txt
Download necessary NLP models
python3 -m spacy download en_core_web_sm
python3 -m nltk.downloader popular
uvicorn app.main:app --reload
The API should now be running on http://localhost:8000
. You can access the documentation at http://localhost:8000/docs
.
Here's an example of how to use the API via curl
:
curl -X 'POST' \
'http://localhost:8000/analyze/sentiment' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"text": "I love using FastAPI!"}'
Response
{
"sentiment": "Positive"
}
curl -X 'POST' \
'http://localhost:8000/analyze/keywords' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"text": "FastAPI is a modern, fast (high-performance), web framework for building APIs."}'
Response
{
"result": "FastAPI, modern, fast, web, framework, APIs"
}
curl -X 'POST' \
'http://localhost:8000/analyze/summary' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"text": "FastAPI is a great tool. It helps you build APIs really fast."}'
Response
{
"result": "FastAPI is a great tool."
}
Contributions are welcome and appreciated. You can contribute in various ways such as submitting issues in our repo and creating pull requests for improvements to documentation or code.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.