Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,14 +12,16 @@ if choice == "distilbert-cvent":
|
|
12 |
model_checkpoint = "vives/distilbert-base-uncased-finetuned-cvent-2019_2022"
|
13 |
model = AutoModelForMaskedLM.from_pretrained(model_checkpoint, output_hidden_states=True)
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
15 |
-
kp_dict_checkpoint = "
|
16 |
-
kp_cosine_checkpoint = "
|
|
|
17 |
elif choice == "finbert":
|
18 |
model_checkpoint = "ProsusAI/finbert"
|
19 |
tokenizer = AutoTokenizer.from_pretrained("ProsusAI/finbert")
|
20 |
model = AutoModelForSequenceClassification.from_pretrained("ProsusAI/finbert", output_hidden_states=True)
|
21 |
-
kp_dict_checkpoint = "
|
22 |
-
kp_cosine_checkpoint = "
|
|
|
23 |
text = st.text_input("Enter word or key-phrase")
|
24 |
|
25 |
exclude_words = st.radio("exclude_words",[True,False], help="Exclude results that contain any words in the query (i.e exclude 'hot coffee' if the query is 'cold coffee')")
|
|
|
12 |
model_checkpoint = "vives/distilbert-base-uncased-finetuned-cvent-2019_2022"
|
13 |
model = AutoModelForMaskedLM.from_pretrained(model_checkpoint, output_hidden_states=True)
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
15 |
+
kp_dict_checkpoint = "kp_dict_merged.pickle"
|
16 |
+
kp_cosine_checkpoint = "cosine_kp.pickle"
|
17 |
+
|
18 |
elif choice == "finbert":
|
19 |
model_checkpoint = "ProsusAI/finbert"
|
20 |
tokenizer = AutoTokenizer.from_pretrained("ProsusAI/finbert")
|
21 |
model = AutoModelForSequenceClassification.from_pretrained("ProsusAI/finbert", output_hidden_states=True)
|
22 |
+
kp_dict_checkpoint = "kp_dict_finbert.pickle"
|
23 |
+
kp_cosine_checkpoint = "cosine_kp_finbert.pickle"
|
24 |
+
|
25 |
text = st.text_input("Enter word or key-phrase")
|
26 |
|
27 |
exclude_words = st.radio("exclude_words",[True,False], help="Exclude results that contain any words in the query (i.e exclude 'hot coffee' if the query is 'cold coffee')")
|