Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,24 +9,6 @@ from openprompt.prompts import ManualTemplate
|
|
| 9 |
from openprompt.data_utils import InputExample
|
| 10 |
from openprompt import PromptForClassification
|
| 11 |
|
| 12 |
-
# def sentiment_analysis(sentence, template, positive, neutral, nagetive ):
|
| 13 |
-
# model_name = "bert-base-uncased"
|
| 14 |
-
# nlp = pipeline("fill-mask", model=model_name)
|
| 15 |
-
# text = template.replace("[SENTENCE]",sentence)
|
| 16 |
-
# # return str(nlp(text))
|
| 17 |
-
# return sentence + template + positive + neutral + nagetive
|
| 18 |
-
|
| 19 |
-
# demo = gr.Interface(fn=sentiment_analysis,
|
| 20 |
-
# inputs = [gr.Textbox(placeholder="Enter sentence here.",label="sentence"),
|
| 21 |
-
# gr.Textbox(placeholder="Your template must have a [SENTENCE] token and a [MASK] token.",label="template"),
|
| 22 |
-
# gr.Textbox(placeholder="Separate words with Spaces.",label="positive"),
|
| 23 |
-
# gr.Textbox(placeholder="Separate words with Spaces.",label="neutral"),
|
| 24 |
-
# gr.Textbox(placeholder="Separate words with Spaces.",label="negative")
|
| 25 |
-
# ],
|
| 26 |
-
# outputs="text")
|
| 27 |
-
|
| 28 |
-
# demo.launch(server_port=8080)
|
| 29 |
-
|
| 30 |
def readLMwords():
|
| 31 |
alldata = pd.read_csv("LoughranMcDonald_MasterDictionary_2020.csv")
|
| 32 |
positive = list(alldata[alldata["Positive"]!=0]["Word"].str.lower())
|
|
|
|
| 9 |
from openprompt.data_utils import InputExample
|
| 10 |
from openprompt import PromptForClassification
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
def readLMwords():
|
| 13 |
alldata = pd.read_csv("LoughranMcDonald_MasterDictionary_2020.csv")
|
| 14 |
positive = list(alldata[alldata["Positive"]!=0]["Word"].str.lower())
|