Spaces:
Runtime error
Runtime error
Commit
·
57cba06
1
Parent(s):
8e8bf44
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,9 +5,9 @@ import whisper
|
|
| 5 |
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
|
| 13 |
model = whisper.load_model('base')
|
|
@@ -23,8 +23,8 @@ def get_transcript_sentiment(url):
|
|
| 23 |
result = model.transcribe('audio.mp3')
|
| 24 |
|
| 25 |
# Split the transcript into sentences
|
| 26 |
-
|
| 27 |
-
transcript_sentences = result['text'].split('.')
|
| 28 |
|
| 29 |
# Run the Hugging Face sentiment analysis pipeline
|
| 30 |
sentiment_pipeline = pipeline('sentiment-analysis')
|
|
|
|
| 5 |
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
+
import nltk
|
| 9 |
+
nltk.download('punkt')
|
| 10 |
+
from nltk.tokenize import sent_tokenize
|
| 11 |
|
| 12 |
|
| 13 |
model = whisper.load_model('base')
|
|
|
|
| 23 |
result = model.transcribe('audio.mp3')
|
| 24 |
|
| 25 |
# Split the transcript into sentences
|
| 26 |
+
transcript_sentences = sent_tokenize(result['text'])
|
| 27 |
+
#transcript_sentences = result['text'].split('.')
|
| 28 |
|
| 29 |
# Run the Hugging Face sentiment analysis pipeline
|
| 30 |
sentiment_pipeline = pipeline('sentiment-analysis')
|