Update README.md
Browse files
README.md
CHANGED
@@ -67,16 +67,14 @@ For simplicity, you can run this here:
|
|
67 |
Alternatively, embed the following code in your application:
|
68 |
|
69 |
```python
|
70 |
-
import
|
71 |
-
from transformers import AutoTokenizer, AutoConfig
|
72 |
-
|
73 |
-
# Load the tokenizer and model from the local directory
|
74 |
-
model_dir = "gsar78/HellenicSentimentAI_v2"
|
75 |
-
tokenizer = AutoTokenizer.from_pretrained(model_dir)
|
76 |
-
config = AutoConfig.from_pretrained(model_dir)
|
77 |
-
model = CustomModel.from_pretrained(model_dir, config=config, num_emotion_labels=18)
|
78 |
|
|
|
79 |
|
|
|
|
|
|
|
|
|
80 |
|
81 |
# Function to predict sentiment and emotion
|
82 |
def predict(texts):
|
|
|
67 |
Alternatively, embed the following code in your application:
|
68 |
|
69 |
```python
|
70 |
+
from transformers import AutoConfig, AutoModelForSequenceClassification, AutoTokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
model_name = "gsar78/HellenicSentimentAI_v2"
|
73 |
|
74 |
+
# Load the configuration, tokenizer, and model
|
75 |
+
config = AutoConfig.from_pretrained(model_name)
|
76 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
77 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
78 |
|
79 |
# Function to predict sentiment and emotion
|
80 |
def predict(texts):
|