Skip to content

Commit

Permalink
updated documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed Jul 20, 2022
1 parent 89efd7a commit 3b151bc
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 3 deletions.
13 changes: 13 additions & 0 deletions README.kr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,19 @@ tomotopy의 Python3 예제 코드는 https://github.com/bab2min/tomotopy/blob/ma

역사
-------
* 0.12.3 (2022-07-19)
* 기능 개선
* 이제 `tomotopy.LDAModel.add_doc()`로 빈 문서를 삽입할 경우 예외를 발생시키는 대신 그냥 무시합니다. 새로 추가된 인자인 `ignore_empty_words`를 False로 설정할 경우 이전처럼 예외를 발생시킵니다.
* 유효하지 않은 토픽들을 모델에서 제거하는 `tomotopy.HDPModel.purge_dead_topics()` 메소드가 추가되었습니다.
* 버그 수정
* `tomotopy.SLDAModel`에서 `nuSq` 값을 지정할 때 발생하는 문제를 해결했습니다. (by @jucendrero)
* `tomotopy.utils.Coherence`가 `tomotopy.DTModel`에 대해서 작동하지 않는 문제를 해결했습니다.
* `train()` 호출 전에 `make_dic()`을 호출할 때 종종 크래시가 발생하는 문제를 해결했습니다.
* seed가 고정된 상태에서도 `tomotopy.DMRModel`, `tomotopy.GDMRModel`의 결과가 다르게 나오는 문제를 해결했습니다.
* `tomotopy.DMRModel`, `tomotopy.GDMRModel`의 파라미터 최적화 과정이 부정확하던 문제를 해결했습니다.
* `tomotopy.PTModel.copy()` 호출 시 종종 크래시가 발생하는 문제를 해결했습니다.
* 싱글스레드에서의 작동 효율을 개선했습니다.

* 0.12.2 (2021-09-06)
* `min_cf > 0`, `min_df > 0`나 `rm_top > 0`로 설정된 `tomotopy.HDPModel`에서 `convert_to_lda`를 호출할때 크래시가 발생하는 문제를 해결했습니다.
* `tomotopy.Document.get_topics`와 `tomotopy.Document.get_topic_dist`에 `from_pseudo_doc` 인자가 추가되었습니다.
Expand Down
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,18 @@ meaning you can use it for any reasonable purpose and remain in complete ownersh

History
-------
* 0.12.3 (2022-07-19)
* New features
* Now, inserting an empty document using `tomotopy.LDAModel.add_doc()` just ignores it instead of raising an exception. If the newly added argument `ignore_empty_words` is set to False, an exception is raised as before.
* `tomotopy.HDPModel.purge_dead_topics()` method is added to remove non-live topics from the model.
* Bug fixes
* Fixed an issue that prevents setting user defined values for nuSq in `tomotopy.SLDAModel` (by @jucendrero).
* Fixed an issue where `tomotopy.utils.Coherence` did not work for `tomotopy.DTModel`.
* Fixed an issue that often crashed when calling `make_dic()` before calling `train()`.
* Resolved the problem that the results of `tomotopy.DMRModel` and `tomotopy.GDMRModel` are different even when the seed is fixed.
* The parameter optimization process of `tomotopy.DMRModel` and `tomotopy.GDMRModel` has been improved.
* Fixed an issue that sometimes crashed when calling `tomotopy.PTModel.copy()`.

* 0.12.2 (2021-09-06)
* An issue where calling `convert_to_lda` of `tomotopy.HDPModel` with `min_cf > 0`, `min_df > 0` or `rm_top > 0` causes a crash has been fixed.
* A new argument `from_pseudo_doc` is added to `tomotopy.Document.get_topics` and `tomotopy.Document.get_topic_dist`.
Expand Down
3 changes: 2 additions & 1 deletion document/document_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
<a class="homelink" rel="home" title="tomotopy Home" href="/tomotopy" style="display:block; font-size:2em; font-weight:bold; color:#555; padding-bottom:.5em; border-bottom:1px solid silver;"> <img src="/tomotopy/tomoto.png" alt="" style="height:1.5em;"> tomotopy </a>
<a id='lang-en' href="../en/index.html">English</a> <a id='lang-kr' href="../kr/index.html">한국어</a>
<div id="version-link">
<span>v0.12.2</span>
<span>v0.12.3</span>
<ul>
<li><a href='/tomotopy/v0.12.3/en'>v0.12.3</a></li>
<li><a href='/tomotopy/v0.12.2/en'>v0.12.2</a></li>
<li><a href='/tomotopy/v0.12.1/en'>v0.12.1</a></li>
<li><a href='/tomotopy/v0.12.0/en'>v0.12.0</a></li>
Expand Down
17 changes: 17 additions & 0 deletions src/python/docs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,23 @@ topic_threshold : float
기본값은 0이며, 이 경우 유효하지 않는 토픽을 제외한 모든 토픽이 LDA 모델에 포함됩니다.
)"");

DOC_SIGNATURE_EN_KO(HDP_purge_dead_topics__doc__,
"purge_dead_topics(self)",
u8R""(.. versionadded:: 0.12.3
Purge all non-alive topics from the model and return `new_topic_ids`. After called, `HDPModel.k` shrinks to `HDPModel.live_k` and all topics of the model become live.
`new_topic_id` is an array of length `HDPModel.k` and `new_topic_id[i]` indicates a topic id of the new model, equivalent to topic `i` of previous HDP model.
If topic `i` of previous HDP model is not alive or is removed in the new model, `new_topic_id[i]` would be `-1`.
)"",
u8R""(.. versionadded:: 0.12.3
현재 모델에서 유효하지 않은 토픽을 모두 제거하고 `new_topic_ids`를 반환합니다. 호출 후에 `HDPModel.k`는 `HDPModel.live_k`값으로 줄어들며 모든 토픽은 유효한 상태가 됩니다.
`new_topic_id`는 길이 `HDPModel.k`의 배열이며, `new_topic_id[i]`는 새 모델에서 기존 HDP 모델의 토픽 `i`와 동등한 토픽의 id를 가리킵니다.
만약 기존 HDP 모델의 토픽 `i`가 유효하지 않거나, 새 모델에서 제거된 것이라면, `new_topic_id[i]`는 `-1`이 됩니다.
)"");

DOC_VARIABLE_EN_KO(HDP_gamma__doc__,
u8R""(the hyperparameter gamma (read-only))"",
u8R""(하이퍼 파라미터 gamma (읽기전용))"");
Expand Down
2 changes: 1 addition & 1 deletion src/python/py_HDP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static PyMethodDef HDP_methods[] =
{ "loads", (PyCFunction)HDP_loads, METH_STATIC | METH_VARARGS | METH_KEYWORDS, LDA_loads__doc__ },
{ "is_live_topic", (PyCFunction)HDP_isLiveTopic, METH_VARARGS | METH_KEYWORDS, HDP_is_live_topic__doc__ },
{ "convert_to_lda", (PyCFunction)HDP_convertToLDA, METH_VARARGS | METH_KEYWORDS, HDP_convert_to_lda__doc__ },
{ "purge_dead_topics", (PyCFunction)HDP_purgeDeadTopics, METH_NOARGS, HDP_convert_to_lda__doc__ },
{ "purge_dead_topics", (PyCFunction)HDP_purgeDeadTopics, METH_NOARGS, HDP_purge_dead_topics__doc__ },
{ nullptr }
};

Expand Down
8 changes: 7 additions & 1 deletion tomotopy/coherence.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ def get_score(self, words=None, topic_id=None, timepoint=None):
This parameter is valid when `tomotopy.coherence.Coherence` was initialized using `corpus` as `tomotopy.LDAModel` or its descendants.
If this is omitted, the average score of all topics is returned.
timepoint : int
A timepoint of the topic from which words are extracted. (Only for `DTModel`)
..versionadded:: 0.12.3
A timepoint of the topic from which words are extracted. (Only for `tomotopy.DTModel`)
'''
import tomotopy as tp
if words is None and self._topic_model is None:
Expand Down Expand Up @@ -251,5 +253,9 @@ def get_score(self, words=None, topic_id=None, timepoint=None):
단어가 추출될 토픽의 id.
이 파라미터는 오직 `tomotopy.coherence.Coherence`가 `tomotopy.LDAModel`나 기타 토픽 모델의 인스턴스로 `corpus`를 받아 초기화된 경우에만 사용 가능합니다.
생략시 모든 토픽의 coherence 점수를 평균낸 값이 반환됩니다.
timepoint : int
..versionadded:: 0.12.3
단어가 추출될 토픽의 시점 (`tomotopy.DTModel`에서만 유효)
'''
del os
12 changes: 12 additions & 0 deletions tomotopy/documentation.kr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,18 @@ tomotopy의 Python3 예제 코드는 https://github.com/bab2min/tomotopy/blob/ma

역사
-------
* 0.12.3 (2022-07-19)
* 기능 개선
* 이제 `tomotopy.LDAModel.add_doc()`로 빈 문서를 삽입할 경우 예외를 발생시키는 대신 그냥 무시합니다. 새로 추가된 인자인 `ignore_empty_words`를 False로 설정할 경우 이전처럼 예외를 발생시킵니다.
* 유효하지 않은 토픽들을 모델에서 제거하는 `tomotopy.HDPModel.purge_dead_topics()` 메소드가 추가되었습니다.
* 버그 수정
* `tomotopy.SLDAModel`에서 `nuSq` 값을 지정할 때 발생하는 문제를 해결했습니다. (by @jucendrero)
* `tomotopy.utils.Coherence`가 `tomotopy.DTModel`에 대해서 작동하지 않는 문제를 해결했습니다.
* `train()` 호출 전에 `make_dic()`을 호출할 때 종종 크래시가 발생하는 문제를 해결했습니다.
* seed가 고정된 상태에서도 `tomotopy.DMRModel`, `tomotopy.GDMRModel`의 결과가 다르게 나오는 문제를 해결했습니다.
* `tomotopy.DMRModel`, `tomotopy.GDMRModel`의 파라미터 최적화 과정이 부정확하던 문제를 해결했습니다.
* `tomotopy.PTModel.copy()` 호출 시 종종 크래시가 발생하는 문제를 해결했습니다.

* 0.12.2 (2021-09-06)
* `min_cf > 0`, `min_df > 0`나 `rm_top > 0`로 설정된 `tomotopy.HDPModel`에서 `convert_to_lda`를 호출할때 크래시가 발생하는 문제를 해결했습니다.
* `tomotopy.Document.get_topics`와 `tomotopy.Document.get_topic_dist`에 `from_pseudo_doc` 인자가 추가되었습니다.
Expand Down
12 changes: 12 additions & 0 deletions tomotopy/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,18 @@ meaning you can use it for any reasonable purpose and remain in complete ownersh

History
-------
* 0.12.3 (2022-07-19)
* New features
* Now, inserting an empty document using `tomotopy.LDAModel.add_doc()` just ignores it instead of raising an exception. If the newly added argument `ignore_empty_words` is set to False, an exception is raised as before.
* `tomotopy.HDPModel.purge_dead_topics()` method is added to remove non-live topics from the model.
* Bug fixes
* Fixed an issue that prevents setting user defined values for nuSq in `tomotopy.SLDAModel` (by @jucendrero).
* Fixed an issue where `tomotopy.utils.Coherence` did not work for `tomotopy.DTModel`.
* Fixed an issue that often crashed when calling `make_dic()` before calling `train()`.
* Resolved the problem that the results of `tomotopy.DMRModel` and `tomotopy.GDMRModel` are different even when the seed is fixed.
* The parameter optimization process of `tomotopy.DMRModel` and `tomotopy.GDMRModel` has been improved.
* Fixed an issue that sometimes crashed when calling `tomotopy.PTModel.copy()`.

* 0.12.2 (2021-09-06)
* An issue where calling `convert_to_lda` of `tomotopy.HDPModel` with `min_cf > 0`, `min_df > 0` or `rm_top > 0` causes a crash has been fixed.
* A new argument `from_pseudo_doc` is added to `tomotopy.Document.get_topics` and `tomotopy.Document.get_topic_dist`.
Expand Down

0 comments on commit 3b151bc

Please sign in to comment.