Skip to content

Commit 5d4604a

Browse files
committed
minor fixes
1 parent 928d391 commit 5d4604a

7 files changed

Lines changed: 26 additions & 4 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ coherence = btm.coherence(model.matrix_topics_words_, X, M=20)
8787
# or
8888
perplexity = model.perplexity_
8989
coherence = model.coherence_
90+
91+
# LABELS
92+
model.labels_
93+
# or
94+
btm.get_docs_top_topic(texts, model.matrix_docs_topics_)
9095
```
9196

9297
### Results visualization

docs/source/bitermplus.util.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ Utility functions
77
.. autofunction:: get_vectorized_docs
88
.. autofunction:: get_biterms
99
.. autofunction:: get_top_topic_words
10-
.. autofunction:: get_top_topic_docs
10+
.. autofunction:: get_top_topic_docs
11+
.. autofunction:: get_docs_top_topic

docs/source/tutorial.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ variation distance.
123123
Model loading and saving
124124
------------------------
125125

126-
Support for model serializing with `pickle <https://docs.python.org/3/library/pickle.html>`_ was implemented in v0.5.3.
126+
Support for model serializing with `pickle
127+
<https://docs.python.org/3/library/pickle.html>`_ was implemented in v0.5.3.
127128
Here is how you can save and load a model:
128129

129130
.. code-block:: python

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ classifiers =
1313
License :: OSI Approved :: MIT License
1414
Operating System :: OS Independent
1515
Programming Language :: Python :: 3
16+
Programming Language :: Python :: 3.6
17+
Programming Language :: Python :: 3.7
18+
Programming Language :: Python :: 3.8
19+
Programming Language :: Python :: 3.9
20+
Programming Language :: Python :: 3.10
1621
Topic :: Scientific/Engineering :: Information Analysis
1722
Topic :: Text Processing :: General
1823

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from setuptools import setup, Extension
21
from platform import system
2+
from setuptools import setup, Extension
33
from Cython.Build import cythonize
44
# from numpy import get_include
55

src/bitermplus/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.6.11'
1+
__version__ = '0.6.12'
22

33
from bitermplus._btm import BTM
44
from bitermplus._util import *

src/bitermplus/_util.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,5 +247,15 @@ def get_docs_top_topic(
247247
-------
248248
DataFrame
249249
Documents and the most probable topic for each of them.
250+
251+
Example
252+
-------
253+
>>> import bitermplus as btm
254+
>>> # Read documents from file
255+
>>> # texts = ...
256+
>>> # Build and train a model
257+
>>> # model = ...
258+
>>> # model.fit(...)
259+
>>> btm.get_docs_top_topic(texts, model.matrix_docs_topics_)
250260
"""
251261
return DataFrame({'documents': docs, 'label': p_zd.argmax(axis=1)})

0 commit comments

Comments
 (0)