未验证 提交 be334f2b 编写于 作者: Z Zeyu Chen 提交者: GitHub

Fix Topic Model return bug

Bug fix: Return NoneType
...@@ -137,3 +137,7 @@ paddlehub >= 1.8.0 ...@@ -137,3 +137,7 @@ paddlehub >= 1.8.0
* 1.0.0 * 1.0.0
初始发布 初始发布
* 1.0.1
修复因为return的bug导致的NoneType错误
...@@ -97,7 +97,7 @@ class LDADoc(object): ...@@ -97,7 +97,7 @@ class LDADoc(object):
topic_dist = [] topic_dist = []
sum_ = np.sum(self._accum_topic_sum) sum_ = np.sum(self._accum_topic_sum)
if sum_ == 0: if sum_ == 0:
return return topic_dist
for i in range(0, self._num_topics): for i in range(0, self._num_topics):
if self._accum_topic_sum[i] == 0: if self._accum_topic_sum[i] == 0:
continue continue
......
...@@ -14,7 +14,7 @@ from lda_news.vocab import Vocab, WordCount ...@@ -14,7 +14,7 @@ from lda_news.vocab import Vocab, WordCount
@moduleinfo( @moduleinfo(
name="lda_news", name="lda_news",
version="1.0.0", version="1.0.1",
summary= summary=
"This is a PaddleHub Module for LDA topic model in news dataset, where we can calculate doc distance, calculate the similarity between query and document, etc", "This is a PaddleHub Module for LDA topic model in news dataset, where we can calculate doc distance, calculate the similarity between query and document, etc",
author="DesmonDay", author="DesmonDay",
......
...@@ -137,3 +137,7 @@ paddlehub >= 1.8.0 ...@@ -137,3 +137,7 @@ paddlehub >= 1.8.0
* 1.0.0 * 1.0.0
初始发布 初始发布
* 1.0.1
修复因为return的bug导致的NoneType错误
...@@ -97,7 +97,7 @@ class LDADoc(object): ...@@ -97,7 +97,7 @@ class LDADoc(object):
topic_dist = [] topic_dist = []
sum_ = np.sum(self._accum_topic_sum) sum_ = np.sum(self._accum_topic_sum)
if sum_ == 0: if sum_ == 0:
return return topic_dist
for i in range(0, self._num_topics): for i in range(0, self._num_topics):
if self._accum_topic_sum[i] == 0: if self._accum_topic_sum[i] == 0:
continue continue
......
...@@ -14,7 +14,7 @@ from lda_novel.vocab import Vocab, WordCount ...@@ -14,7 +14,7 @@ from lda_novel.vocab import Vocab, WordCount
@moduleinfo( @moduleinfo(
name="lda_novel", name="lda_novel",
version="1.0.0", version="1.0.1",
summary= summary=
"This is a PaddleHub Module for LDA topic model in novel dataset, where we can calculate doc distance, calculate the similarity between query and document, etc.", "This is a PaddleHub Module for LDA topic model in novel dataset, where we can calculate doc distance, calculate the similarity between query and document, etc.",
author="DesmonDay", author="DesmonDay",
......
...@@ -133,3 +133,7 @@ paddlehub >= 1.8.0 ...@@ -133,3 +133,7 @@ paddlehub >= 1.8.0
* 1.0.0 * 1.0.0
初始发布 初始发布
* 1.0.1
修复因为return的bug导致的NoneType错误
...@@ -97,7 +97,7 @@ class LDADoc(object): ...@@ -97,7 +97,7 @@ class LDADoc(object):
topic_dist = [] topic_dist = []
sum_ = np.sum(self._accum_topic_sum) sum_ = np.sum(self._accum_topic_sum)
if sum_ == 0: if sum_ == 0:
return return topic_dist
for i in range(0, self._num_topics): for i in range(0, self._num_topics):
if self._accum_topic_sum[i] == 0: if self._accum_topic_sum[i] == 0:
continue continue
......
...@@ -14,7 +14,7 @@ from lda_webpage.vocab import Vocab, WordCount ...@@ -14,7 +14,7 @@ from lda_webpage.vocab import Vocab, WordCount
@moduleinfo( @moduleinfo(
name="lda_webpage", name="lda_webpage",
version="1.0.0", version="1.0.1",
summary= summary=
"This is a PaddleHub Module for LDA topic model in webpage dataset, where we can calculate doc distance, calculate the similarity between query and document, etc.", "This is a PaddleHub Module for LDA topic model in webpage dataset, where we can calculate doc distance, calculate the similarity between query and document, etc.",
author="DesmonDay", author="DesmonDay",
......
...@@ -97,7 +97,7 @@ class LDADoc(object): ...@@ -97,7 +97,7 @@ class LDADoc(object):
topic_dist = [] topic_dist = []
sum_ = np.sum(self._accum_topic_sum) sum_ = np.sum(self._accum_topic_sum)
if sum_ == 0: if sum_ == 0:
return return topic_dist
for i in range(0, self._num_topics): for i in range(0, self._num_topics):
if self._accum_topic_sum[i] == 0: if self._accum_topic_sum[i] == 0:
continue continue
......
...@@ -97,7 +97,7 @@ class LDADoc(object): ...@@ -97,7 +97,7 @@ class LDADoc(object):
topic_dist = [] topic_dist = []
sum_ = np.sum(self._accum_topic_sum) sum_ = np.sum(self._accum_topic_sum)
if sum_ == 0: if sum_ == 0:
return return topic_dist
for i in range(0, self._num_topics): for i in range(0, self._num_topics):
if self._accum_topic_sum[i] == 0: if self._accum_topic_sum[i] == 0:
continue continue
......
...@@ -97,7 +97,7 @@ class LDADoc(object): ...@@ -97,7 +97,7 @@ class LDADoc(object):
topic_dist = [] topic_dist = []
sum_ = np.sum(self._accum_topic_sum) sum_ = np.sum(self._accum_topic_sum)
if sum_ == 0: if sum_ == 0:
return return topic_dist
for i in range(0, self._num_topics): for i in range(0, self._num_topics):
if self._accum_topic_sum[i] == 0: if self._accum_topic_sum[i] == 0:
continue continue
......
...@@ -97,7 +97,7 @@ class LDADoc(object): ...@@ -97,7 +97,7 @@ class LDADoc(object):
topic_dist = [] topic_dist = []
sum_ = np.sum(self._accum_topic_sum) sum_ = np.sum(self._accum_topic_sum)
if sum_ == 0: if sum_ == 0:
return return topic_dist
for i in range(0, self._num_topics): for i in range(0, self._num_topics):
if self._accum_topic_sum[i] == 0: if self._accum_topic_sum[i] == 0:
continue continue
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册