Spaces:
Sleeping
Sleeping
Commit
·
6208c00
1
Parent(s):
628d0a9
fixed conflicts
Browse files- requirements.txt +0 -0
- sentiV_v2.py +7 -1
requirements.txt
CHANGED
|
Binary files a/requirements.txt and b/requirements.txt differ
|
|
|
sentiV_v2.py
CHANGED
|
@@ -11,13 +11,19 @@ from selenium.webdriver.chrome.options import Options
|
|
| 11 |
from webdriver_manager.chrome import ChromeDriverManager
|
| 12 |
from nltk.sentiment import SentimentIntensityAnalyzer
|
| 13 |
import time
|
|
|
|
| 14 |
|
| 15 |
# Download NLTK resources
|
| 16 |
nltk.download('vader_lexicon')
|
| 17 |
sia = SentimentIntensityAnalyzer()
|
| 18 |
|
| 19 |
# Load spaCy Named Entity Recognition model
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# Load BERT Sentiment Analyzer
|
| 23 |
bert_sentiment = pipeline("sentiment-analysis", model="siebert/sentiment-roberta-large-english")
|
|
|
|
| 11 |
from webdriver_manager.chrome import ChromeDriverManager
|
| 12 |
from nltk.sentiment import SentimentIntensityAnalyzer
|
| 13 |
import time
|
| 14 |
+
import subprocess
|
| 15 |
|
| 16 |
# Download NLTK resources
|
| 17 |
nltk.download('vader_lexicon')
|
| 18 |
sia = SentimentIntensityAnalyzer()
|
| 19 |
|
| 20 |
# Load spaCy Named Entity Recognition model
|
| 21 |
+
try:
|
| 22 |
+
nlp = spacy.load("en_core_web_sm")
|
| 23 |
+
except OSError:
|
| 24 |
+
print("Downloading 'en_core_web_sm' model...")
|
| 25 |
+
subprocess.run(["python", "-m", "spacy", "download", "en_core_web_sm"])
|
| 26 |
+
nlp = spacy.load("en_core_web_sm")
|
| 27 |
|
| 28 |
# Load BERT Sentiment Analyzer
|
| 29 |
bert_sentiment = pipeline("sentiment-analysis", model="siebert/sentiment-roberta-large-english")
|