Skip to content

Commit

Permalink
0.2.6 优化模块的输出
Browse files Browse the repository at this point in the history
  • Loading branch information
DTC@Cyberbolt authored and DTC@Cyberbolt committed Feb 21, 2021
1 parent 98c332d commit cdf39c2
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Cemotion-apple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ text mode
```
#使用列表进行批量分析
from cemotion import Cemotion
list_text = ['内饰蛮年轻的,而且看上去质感都蛮好,貌似本田所有车都有点相似,满高档的!',
'总而言之,是一家不会再去的店。']
c = Cemotion()
print(c.predict(list_text))
```
Expand Down
4 changes: 2 additions & 2 deletions Cemotion-apple/cemotion/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self):
def predict(self, text):
#输入内容为文字时 返回 正负概率
if type(text) == type('text mode'):
print('text mode')
# print('text mode')
list_text = [text] #将文本转为列表
#获取预测值 预测一个值时使用predict_on_batch
prediction = self.__rnn.predict_on_batch(self.__dataset.data_to_train(list_text))[0][0]
Expand All @@ -56,7 +56,7 @@ def predict(self, text):
if type(text) == type(np.array(['list mode'])):
text = text.tolist()

print('list mode')
# print('list mode')
list_text = text
prediction = self.__rnn.predict(self.__dataset.data_to_train(list_text))

Expand Down
2 changes: 1 addition & 1 deletion Cemotion-apple/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="Cemotion-apple",
version="0.2.5",
version="0.2.6",
author="Cyberbolt",
author_email="[email protected]",
description="基于NLP的中文情感倾向分析库",
Expand Down
2 changes: 2 additions & 0 deletions Cemotion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ text mode
```
#使用列表进行批量分析
from cemotion import Cemotion
list_text = ['内饰蛮年轻的,而且看上去质感都蛮好,貌似本田所有车都有点相似,满高档的!',
'总而言之,是一家不会再去的店。']
c = Cemotion()
print(c.predict(list_text))
```
Expand Down
4 changes: 2 additions & 2 deletions Cemotion/cemotion/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self):
def predict(self, text):
#输入内容为文字时 返回 正负概率
if type(text) == type('text mode'):
print('text mode')
# print('text mode')
list_text = [text] #将文本转为列表
#获取预测值 预测一个值时使用predict_on_batch
prediction = self.__rnn.predict_on_batch(self.__dataset.data_to_train(list_text))[0][0]
Expand All @@ -56,7 +56,7 @@ def predict(self, text):
if type(text) == type(np.array(['list mode'])):
text = text.tolist()

print('list mode')
# print('list mode')
list_text = text
prediction = self.__rnn.predict(self.__dataset.data_to_train(list_text))

Expand Down
2 changes: 1 addition & 1 deletion Cemotion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="Cemotion",
version="0.2.5",
version="0.2.6",
author="Cyberbolt",
author_email="[email protected]",
description="基于NLP的中文情感倾向分析库",
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ text mode
```
#使用列表进行批量分析
from cemotion import Cemotion
list_text = ['内饰蛮年轻的,而且看上去质感都蛮好,貌似本田所有车都有点相似,满高档的!',
'总而言之,是一家不会再去的店。']
c = Cemotion()
print(c.predict(list_text))
```
Expand Down

0 comments on commit cdf39c2

Please sign in to comment.