-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
29 lines (23 loc) · 978 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# import senti_trend
import time
from src.senti_trend import senti_trend
success, load_time = senti_trend.load_models(['ru', 'ro', 'en'])
print(f" Loaded in: {load_time:0.4f} seconds")
r = senti_trend.sentiment('Hellou! We will rise it', lang='en')
print(r)
tic = time.perf_counter()
senti_trend.sentiment(senti_trend.texts_en[0], lang='en')
toc = time.perf_counter()
print(f" Sentiment calc from sentence takes: {toc - tic:0.8f} seconds")
tic = time.perf_counter()
senti_trend.sentiment(senti_trend.texts_ro[0], lang='ro')
toc = time.perf_counter()
print(f" Sentiment calc from sentence takes: {toc - tic:0.8f} seconds")
tic = time.perf_counter()
senti_trend.sentiment(senti_trend.texts_ru[0], lang='ro')
toc = time.perf_counter()
print(f" Sentiment calc from sentence takes: {toc - tic:0.8f} seconds")
tic = time.perf_counter()
senti_trend.trend(senti_trend.texts_ru[0])
toc = time.perf_counter()
print(f" Trend from sentence takes: {toc - tic:0.8f} seconds")