Para utilizar do ambiente:
pip3 install virtualenv
virtualenv venv
Para configurar as ferramentas:
pip3 install -U flask
Para executar um modulo de template
Utilizar somente quando não tiver uma função associada
export FLASK_APP={{PATH:module}}
export FLASK_ENV=development
flask run
http://localhost:5000/
Para executar um modulo de template
python3 sample.py runserver
http://localhost:5000/
docker build -t gcloud/fakefinder-pln:1.0.0 .
docker run -d -p 80:80 --name pln -t gcloud/fakefinder-pln:1.0.0
docker logs pln --follow
from nltk.tokenize import sent_tokenize
text = "God is Great! I won a lottery."
print(sent_tokenize(text))
Output: ['God is Great!', 'I won a lottery ']
Change $PWD ----> /code/nlp/bow
request:
curl -X POST -d '{"description":"ola mundo, tudo bom","news":["ola mundo","ola"]}' http://localhost:5000/ -H "Content-Type:application/json"
response:
{"description": "ola mundo, tudo bom", "pln-process": {"ola mundo": "0.6666666666666666", "ola": "0.4"}}