Added Finbert
Browse files
app.py
CHANGED
@@ -3,7 +3,11 @@ import gradio as gr
|
|
3 |
|
4 |
asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
|
5 |
summarizer = pipeline("summarization", model="knkarthick/MEETING_SUMMARY")
|
6 |
-
|
|
|
|
|
|
|
|
|
7 |
|
8 |
def transcribe(audio):
|
9 |
text = asr(audio)["text"]
|
@@ -18,7 +22,7 @@ def summarize_text(text):
|
|
18 |
return stext
|
19 |
|
20 |
def text_to_sentiment(text):
|
21 |
-
sentiment =
|
22 |
return sentiment
|
23 |
|
24 |
demo = gr.Blocks()
|
|
|
3 |
|
4 |
asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
|
5 |
summarizer = pipeline("summarization", model="knkarthick/MEETING_SUMMARY")
|
6 |
+
|
7 |
+
auth_token = os.environ.get("HF_Token")
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained("demo-org/auditor_review_model",use_auth_token=auth_token)
|
9 |
+
audit_model = AutoModelForSequenceClassification.from_pretrained("demo-org/auditor_review_model",use_auth_token=auth_token)
|
10 |
+
nlp = pipeline("text-classification", model=audit_model, tokenizer=tokenizer)
|
11 |
|
12 |
def transcribe(audio):
|
13 |
text = asr(audio)["text"]
|
|
|
22 |
return stext
|
23 |
|
24 |
def text_to_sentiment(text):
|
25 |
+
sentiment = nlp(text)[0]["label"]
|
26 |
return sentiment
|
27 |
|
28 |
demo = gr.Blocks()
|