Spaces:
Sleeping

sentiment_analysis / src /config.py
duvr's picture
improve file organization
fe45c80
Raw History Blame Contribute Delete
1.04 kB
import os
# UI --------------------------------------------------------------------------
langs = ["es", "en"]
models = ["SVM", "NB", "LR", "SWEM", "MLP", "RNN", "LSTM"]
cwd = os.getcwd()
models_en_dir = os.path.join(cwd, "models", "en")
models_es_dir = os.path.join(cwd, "models", "es")
# Embeddings -----------------------------------------------------------------
embeddings_path = {
"es": os.path.join(models_es_dir, "embeddings.bin"),
"en": os.path.join(models_en_dir, "embeddings.bin"),
}
AVG_POOLING = "aver"
MAX_POOLING = "max"
LABEL_TO_INDEX = {"NEGATIVE": 0, "NEUTRAL": 1, "POSITIVE": 2}
INDEX_TO_LABEL = {0: "NEGATIVE", 1: "NEUTRAL", 2: "POSITIVE"}
langs_dir = {
"es": os.path.join("models", "es", "classifiers"),
"en": os.path.join("models", "en", "classifiers"),
}
models_name = {
"SVM": "svm_sentiment.pkl",
"NB": "nb_sentiment.pkl",
"LR": "lr_sentiment.pkl",
"SWEM": "swem_sentiment.pkl",
"MLP": "mlp_sentiment.pt",
"RNN": "rnn_sentiment.pt",
"LSTM": "lstm_sentiment.pt",
}