Spaces:
Sleeping
Sleeping
Download src/config.py from duvr/sentiment_analysis: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/duvr/sentiment_analysis/resolve/main/src/config.py
- Command line
-
hf download hf://spaces/duvr/sentiment_analysis/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/duvr/sentiment_analysis/resolve/main/src/config.py
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", | |
| } | |