conf changes
This commit is contained in:
parent
2d7ad3ae76
commit
ac48e98aa9
6 changed files with 25 additions and 26 deletions
|
|
@ -17,4 +17,6 @@ tests/
|
|||
*aws*
|
||||
.elasticbeanstalk
|
||||
|
||||
sentiment-api-465411-ccfc3af56be7.json
|
||||
sentiment-api-*.json
|
||||
|
||||
docker-compose.yml.example
|
||||
|
|
|
|||
2
deployment/api/.gitignore
vendored
2
deployment/api/.gitignore
vendored
|
|
@ -9,4 +9,4 @@
|
|||
|
||||
*aws*
|
||||
|
||||
sentiment-api-465411-ccfc3af56be7.json
|
||||
sentiment-api-*.json
|
||||
|
|
|
|||
|
|
@ -15,6 +15,14 @@ RUN apt-get update && \
|
|||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Install nltk resources at build time
|
||||
RUN python3 -m nltk.downloader punkt \
|
||||
&& python3 -m nltk.downloader punkt_tab \
|
||||
&& python3 -m nltk.downloader stopwords \
|
||||
&& python3 -m nltk.downloader wordnet \
|
||||
&& python3 -m nltk.downloader omw-1.4
|
||||
|
||||
|
||||
# Copy app code and configs
|
||||
COPY . .
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"AWSEBDockerrunVersion": "1",
|
||||
"Image": {
|
||||
"Name": "grgmdmn/sentiment_api:latest",
|
||||
"Update": "true"
|
||||
},
|
||||
"Ports": [
|
||||
{
|
||||
"ContainerPort": "8000"
|
||||
}
|
||||
],
|
||||
"Logging": "/var/log/nginx"
|
||||
}
|
||||
|
|
@ -20,6 +20,8 @@ services:
|
|||
SMTP_FROM_ALIAS: "${SMTP_FROM_ALIAS}" # alias (optionnel)
|
||||
ADMIN_EMAIL: "${ADMIN_EMAIL}" # email admin destinataire
|
||||
|
||||
SENTIMENT_API_BASE_URL: "${SENTIMENT_API_BASE_URL}" # public api url (used to redirect Streamlit requests to FastAPI)
|
||||
|
||||
# only if you have a reverse proxy server
|
||||
# networks:
|
||||
# - swag
|
||||
|
|
|
|||
|
|
@ -5,17 +5,17 @@ from nltk.corpus import stopwords
|
|||
from nltk.tokenize import word_tokenize
|
||||
from nltk.stem import WordNetLemmatizer
|
||||
|
||||
# Assurer que les ressources nécessaires sont disponibles
|
||||
try:
|
||||
stopwords.words('english')
|
||||
word_tokenize("test")
|
||||
WordNetLemmatizer().lemmatize("testing")
|
||||
except LookupError:
|
||||
nltk.download('punkt')
|
||||
nltk.download('punkt_tab')
|
||||
nltk.download('stopwords')
|
||||
nltk.download('wordnet')
|
||||
nltk.download('omw-1.4')
|
||||
# # Assurer que les ressources nécessaires sont disponibles
|
||||
# try:
|
||||
# stopwords.words('english')
|
||||
# word_tokenize("test")
|
||||
# WordNetLemmatizer().lemmatize("testing")
|
||||
# except LookupError:
|
||||
# nltk.download('punkt')
|
||||
# nltk.download('punkt_tab')
|
||||
# nltk.download('stopwords')
|
||||
# nltk.download('wordnet')
|
||||
# nltk.download('omw-1.4')
|
||||
|
||||
def preprocess_tweet(tweet):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue