Giter Club home page Giter Club logo

docker-nlp's Introduction

Docker NLP

This project provides basic Python examples for various Natural Language Processing (NLP) tasks with Docker.

Table of Contents

Getting Started

These instructions will help you get the project up and running on your local machine for development and testing purposes.

Prerequisites

List any prerequisites or dependencies that need to be installed before can use the project.

Task Examples:

  1. Sentiment Analysis: Process of analyzing digital text to determine if the emotional tone of the message is positive, negative, or neutral.

  2. Named Entity Recognition: Identify entities (e.g., persons, organizations, locations) in a given sentence.

  3. Text Classification: Predict the category or class of a given piece of text.

  4. Text Summarization: Generate a summarized version of a longer piece of text (e.g., an article).

  5. Text Translation: Translate a sentence from one language to another.

Usage with Docker :

  1. Pull Docker image

    docker pull harshmanvar/basic-nlp:v1
  2. Run Docker image

    docker run -it harshmanvar/basic-nlp:v1 <file-name.py>
  • Sentiment Analysis Example :

    docker run -it harshmanvar/basic-nlp:v1 01_sentiment_analysis.py

    Enter your input

    Enter the text for semantic analysis (type 'exit' to end): Docker is very cool tool..!
    Sentiment: Positive
    
    Enter the text for semantic analysis (type 'exit' to end): John is Idiot
    Sentiment: Negative
    
    Enter the text for semantic analysis (type 'exit' to end): Elephant
    Sentiment: Neutral
    

Installation:

  1. Clone the repository

    git clone https://github.com/harsh4870/Docker-NLP.git
  2. Install dependencies & Virtual env

    python3 -m venv venv && pip install -r requirements.txt && source venv/bin/activate
  3. Run Examples:

    Choose the specific task you want to run:

    python 01_sentiment_analysis.py
    python 02_name_entity_recognition.py
    python 03_text_classification.py
    python 04_text_summarization.py
    python 05_language_translation.py

Task Examples:

Sentiment Analysis :

docker run -it harshmanvar/basic-nlp:v1 01_sentiment_analysis.py

Enter your input

Enter the text for semantic analysis (type 'exit' to end): Docker is very cool tool..!
Sentiment: Positive

Enter the text for semantic analysis (type 'exit' to end): John is Idiot
Sentiment: Negative

Enter the text for semantic analysis (type 'exit' to end): Elephant
Sentiment: Neutral

Named Entity Recognition :

docker run -it harshmanvar/basic-nlp:v1 02_name_entity_recognition.py

Enter your input

Enter the text for entity recognition (type 'exit' to end): Apple Inc. is planning to open a new store in San Francisco. Tim Cook is the CEO of Apple. 

Entity: Apple Inc., Type: ORG
Entity: San Francisco, Type: GPE
Entity: Tim Cook, Type: PERSON
Entity: Apple, Type: ORG

Text Classification :

docker run -it harshmanvar/basic-nlp:v1 03_text_classification.py

Enter your input

Enter the text for classification (type 'exit' to end): Product is very Good
Accuracy: 1.00
Test Text (Positive): 'Product is very Good'
Predicted Sentiment: Positive

Enter the text for classification (type 'exit' to end): Product is not that good as per reviews
Accuracy: 1.00
Test Text (Positive): 'Product is not that good as per reviews'
Predicted Sentiment: Negative

Text Summarization :

docker run -it harshmanvar/basic-nlp:v1 04_text_summarization.py

Enter your input

Enter the text for summarization (type 'exit' to end): Artificial intelligence (AI) is a branch of computer science that aims to create machines capable of intelligent behavior. These machines are designed to mimic human cognitive functions such as learning, problem-solving, and decision-making. AI technologies can be classified into two main types: narrow or weak AI, which is designed for a particular task, and general or strong AI, which possesses the ability to understand, learn, and apply knowledge across various domains. One of the most popular approaches in AI is machine learning, where algorithms are trained on large datasets to recognize patterns and make predictions.                       

Artificial intelligence (AI) is a branch of computer science that aims to create machines capable of intelligent behavior. These machines are designed to mimic human cognitive functions such as learning, problem-solving, and decision-making.

Text Translation :

docker run -it harshmanvar/basic-nlp:v1 05_language_translation.py

Enter your input

Enter the text for translation (type 'exit' to end): Hello, how are you doing?
Original Text: Hello, how are you doing?
Translated Text: Bonjour comment allez-vous?

docker-nlp's People

Contributors

harsh4870 avatar

Stargazers

Lloyd Zhou avatar  avatar 高亚斌 avatar

Watchers

 avatar 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.