Update README.md
Browse files
README.md
CHANGED
@@ -35,13 +35,16 @@ model = SentenceTransformer('GiliGold/Knesset-multi-e5-large')
|
|
35 |
embedding_vector = model.encode(sentence)
|
36 |
|
37 |
# Load the valence model
|
38 |
-
#Option 1:
|
39 |
with open("valence_model.pkl", "rb") as file:
|
40 |
valence_model = pickle.load(file)
|
41 |
-
|
|
|
42 |
from huggingface_hub import hf_hub_download
|
43 |
repo_id = "GiliGold/VAD_binomial_regression_models"
|
44 |
-
|
|
|
|
|
45 |
|
46 |
# Assume `embedding_vector` is the vector obtained from the Knesset-multi model
|
47 |
valence_score = valence_model.predict([embedding_vector])
|
|
|
35 |
embedding_vector = model.encode(sentence)
|
36 |
|
37 |
# Load the valence model
|
38 |
+
#Option 1: Manually download files from https://huggingface.co/GiliGold/VAD_binomial_regression_models/tree/main)
|
39 |
with open("valence_model.pkl", "rb") as file:
|
40 |
valence_model = pickle.load(file)
|
41 |
+
|
42 |
+
#Option 2: Download using Hugging Face hub
|
43 |
from huggingface_hub import hf_hub_download
|
44 |
repo_id = "GiliGold/VAD_binomial_regression_models"
|
45 |
+
model_v_path = hf_hub_download(repo_id=repo_id, filename="valence_model.pkl")
|
46 |
+
with open(model_v_path, "rb") as f:
|
47 |
+
valence_model = pickle.load(f)
|
48 |
|
49 |
# Assume `embedding_vector` is the vector obtained from the Knesset-multi model
|
50 |
valence_score = valence_model.predict([embedding_vector])
|