Spaces:
Runtime error
Runtime error
Artur Janik
commited on
Commit
•
6281004
1
Parent(s):
ac05dd1
docker is taking FOREVER
Browse files- .gitattributes +12 -0
- language_models_project/app.py +11 -11
- language_models_project/bin/model4/config.json +3 -0
- language_models_project/bin/model4/pytorch_model.bin +3 -0
- language_models_project/bin/model4/special_tokens_map.json +3 -0
- language_models_project/bin/model4/tokenizer.json +3 -0
- language_models_project/bin/model4/tokenizer_config.json +3 -0
- language_models_project/bin/model4/vocab.txt +3 -0
- language_models_project/train.csv +0 -0
.gitattributes
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
bin/model4/config.json filter=lfs diff=lfs merge=lfs -text
|
2 |
+
bin/model4/pytorch_model.bin filter=lfs diff=lfs merge=lfs -text
|
3 |
+
bin/model4/special_tokens_map.json filter=lfs diff=lfs merge=lfs -text
|
4 |
+
bin/model4/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
5 |
+
bin/model4/tokenizer_config.json filter=lfs diff=lfs merge=lfs -text
|
6 |
+
bin/model4/vocab.txt filter=lfs diff=lfs merge=lfs -text
|
7 |
+
language_models_project/bin/model4/config.json filter=lfs diff=lfs merge=lfs -text
|
8 |
+
language_models_project/bin/model4/pytorch_model.bin filter=lfs diff=lfs merge=lfs -text
|
9 |
+
language_models_project/bin/model4/special_tokens_map.json filter=lfs diff=lfs merge=lfs -text
|
10 |
+
language_models_project/bin/model4/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
11 |
+
language_models_project/bin/model4/tokenizer_config.json filter=lfs diff=lfs merge=lfs -text
|
12 |
+
language_models_project/bin/model4/vocab.txt filter=lfs diff=lfs merge=lfs -text
|
language_models_project/app.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
import streamlit as st # Web App
|
2 |
from main import classify
|
3 |
|
4 |
-
demo_phrases = """ Here are some examples:
|
5 |
-
this is a phrase
|
6 |
-
is it neutral
|
7 |
-
nothing else to say
|
8 |
-
man I'm so damn angry
|
9 |
-
sarcasm lol
|
10 |
-
I love this product
|
11 |
-
"""
|
12 |
-
|
13 |
# title
|
14 |
st.title("Sentiment Analysis")
|
15 |
|
@@ -51,7 +51,7 @@ def infer(text: str) -> List[float]:
|
|
51 |
predictions[np.where(probs >= 0.5)] = 1
|
52 |
predictions = pd.Series(predictions == 1)
|
53 |
predictions.index = ["toxic", "severe_toxic", "obscene", "threat", "insult", "identity_hate"]
|
54 |
-
return predictions
|
55 |
|
56 |
|
57 |
def wrapper(*args, **kwargs):
|
@@ -65,7 +65,7 @@ def wrapper(*args, **kwargs):
|
|
65 |
if st.button("Classify"):
|
66 |
st.write("Please allow a few minutes for the model to run/download")
|
67 |
for i in range(len(data)):
|
68 |
-
j =
|
69 |
sentiment = j["label"]
|
70 |
confidence = j["score"]
|
71 |
st.write(
|
|
|
1 |
import streamlit as st # Web App
|
2 |
from main import classify
|
3 |
|
4 |
+
#demo_phrases = """ Here are some examples:
|
5 |
+
#this is a phrase
|
6 |
+
#is it neutral
|
7 |
+
#nothing else to say
|
8 |
+
#man I'm so damn angry
|
9 |
+
#sarcasm lol
|
10 |
+
#I love this product
|
11 |
+
#"""
|
12 |
+
demo_phrases = pd.read_csv('./train.csv')['comment_text'].head(20).astype(str).str.cat(sep='\n')
|
13 |
# title
|
14 |
st.title("Sentiment Analysis")
|
15 |
|
|
|
51 |
predictions[np.where(probs >= 0.5)] = 1
|
52 |
predictions = pd.Series(predictions == 1)
|
53 |
predictions.index = ["toxic", "severe_toxic", "obscene", "threat", "insult", "identity_hate"]
|
54 |
+
return {"label": str(predictions), "score": str(probs)}
|
55 |
|
56 |
|
57 |
def wrapper(*args, **kwargs):
|
|
|
65 |
if st.button("Classify"):
|
66 |
st.write("Please allow a few minutes for the model to run/download")
|
67 |
for i in range(len(data)):
|
68 |
+
j = wrapper(model_name.strip(), data[i])[0]
|
69 |
sentiment = j["label"]
|
70 |
confidence = j["score"]
|
71 |
st.write(
|
language_models_project/bin/model4/config.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:001fd1bd1edb918e108869e486195d8f63d28b3b649d8337f25702e26970fab4
|
3 |
+
size 992
|
language_models_project/bin/model4/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e8b18f3b7a745068b73b94504595e830c33b040c3e3af1dbc2f1fbbc5c1906f
|
3 |
+
size 433329525
|
language_models_project/bin/model4/special_tokens_map.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b6d346be366a7d1d48332dbc9fdf3bf8960b5d879522b7799ddba59e76237ee3
|
3 |
+
size 125
|
language_models_project/bin/model4/tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:343989712a36cd8b253efeaf8baf6a08b9d2583f78e395e83832e8ee9f8d8ee1
|
3 |
+
size 668923
|
language_models_project/bin/model4/tokenizer_config.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a4b08fb5ad902e90782fd47df204b6c21811944c52d65914237ab00f7d945c2b
|
3 |
+
size 315
|
language_models_project/bin/model4/vocab.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:eeaa9875b23b04b4c54ef759d03db9d1ba1554838f8fb26c5d96fa551df93d02
|
3 |
+
size 213450
|
language_models_project/train.csv
ADDED
Binary file (68.8 MB). View file
|
|