Giter Club home page Giter Club logo

nlpower's Introduction

NLPower

Overview

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.

Features

  • Sentiment Analysis: Determine if the sentiment of the input text is positive or negative.
  • Keyword Extraction: Extract significant keywords from the provided text.
  • Text Summarization: Generate a concise summary of the given text.

Technologies

  • FastAPI
  • spacy
  • nltk

Getting Started

Prerequisites

Make sure you have Python 3.8+ installed on your machine. It is also recommended to use a virtual environment for Python projects.

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/nlpower.git
    cd nlpower
  2. Install required Python packages

    pip3 install -r requirements.txt
  3. Download necessary NLP models

    python3 -m spacy download en_core_web_sm
    python3 -m nltk.downloader popular

Running the API

  1. Start the FastAPI server
    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.

Usage

Here's an example of how to use the API via curl:

  • Sentiment Analysis
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"
}
  • Keyword Extraction
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"
}
  • Text Summarization
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."
}

Contribution

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.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

nlpower's People

Contributors

pedcapa avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.