Giter Site home page Giter Site logo

parlay-rest-api's Introduction

Parlay rest

The purpose of this project is to create a REST api using FastAPI that has the ability to 

translate text with auto language detection and then use a natural language processing tool

called vaderSentiment that analyze the text and returns polarity scores. 

-------------------------------------------------------------------------------------------

This project was deployed on Google Cloud Platform. It incorporates technology such as:
        - docker-machine
        - docker
        - dockerhub & gcp
        - python's FastAPI
        - python module Deep Translator (text translation): https://github.com/nidhaloff/deep-translator
        - python module vaderSentiment (text sentiment analysis):  https://github.com/cjhutto/vaderSentiment

Run the /parlay-rest/app/main.py locally on computer.

    # Make sure you're in the parlay-rest directory where the requirements.txt is.
    run "pip install -r requirements.txt"

    # After the installs are complete.
    run:
            uvicorn main:app --host {insert ip address} --port {desired port number} --reload
           Ex: 
            uvicorn main:app --host 0.0.0.0 --port 5057 --reload

Run on Container on Mac

    # This command is for creating a new docker-machine if on OSX
    docker-machine create --driver virtualbox {insert machine name}
    Ex: docker-machine create --driver virtualbox test

    # Starts desired machine 
    docker-machine start  {insert machine name}  
    Ex: docker-machine start test  

    # push to docker hub for gcp
    docker build -t {username}/parlay-rest:latest .
    
    #Before you push it to dockerhub run it locally. Run Tests.
    docker run --name {username}/parlay-rest:latest -p5057:5057 --rm {username}/parlay-rest:latest

    # To make updates to this code and push them to gcp:
    docker push {username}/parlay-rest:latest

Endpoints

/test
    - Purpose is to check if the application is alive.

/vader/{data}
        - Purpose is to recieve text, which it then processes and returns with a polarity score.

/translate/{input_language}/{output_language}/{data}
        - Purpose is to translate language text is wriiten in to output or desired language.

/vader-non-english/{input_language}/{output_language}/{data}
        - Purpose is to use vader with non-english based languages and have it return with a polarity scores after translating the initial non-english based text to english.

test

    In the test directory there is a python script called "test.py" that has functions that and test cases to check if everything on the REST api is 
    working and returning properly.


    usage example:

        cd tests
        python test.py {Ip address} {Port Number}
        python test.py 0.0.0.0 5050

     usage of custom_mesaage():

        python test.py {Ip address} {Port Number} "Insert desired message you want to send"

        python test.py 0.0.0.0 5050 "This movie is not very good."

parlay-rest-api's People

Contributors

muhtasimmutasim avatar

Watchers

 avatar

parlay-rest-api's Issues

[Question] More description on Parlay REST

Hello friend, while searching for Parlay REST I just found your repo, I am currently working with telecom, and I am not familiar with Parlay REST, is it related to SOAP or REST? The documentation the ISP sent me mentions WSSE as an authorization method which seems related to SOAP when I search for it.

Any ideas, please?

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.