From a957b0b1925da8113dcaeadf0aa4e8126efb24cd Mon Sep 17 00:00:00 2001 From: husein zolkepli Date: Tue, 25 Dec 2018 23:23:01 +0800 Subject: [PATCH] fixing docs --- docs/load-topic-modelling.rst | 174 +++++++++++++++---------------- docs/load-topics-influencers.rst | 60 ++++++----- docs/load-toxic.rst | 95 +++++++++-------- docs/load-word2vec.rst | 25 +++-- docs/text-clustering.rst | 26 +++-- 5 files changed, 186 insertions(+), 194 deletions(-) diff --git a/docs/load-topic-modelling.rst b/docs/load-topic-modelling.rst index 25ad60e7..951ebcef 100644 --- a/docs/load-topic-modelling.rst +++ b/docs/load-topic-modelling.rst @@ -1,10 +1,10 @@ -.. code:: ipython3 +.. code:: python import pandas as pd import malaya -.. code:: ipython3 +.. code:: python df = pd.read_csv('tests/02032018.csv',sep=';') df = df.iloc[3:,1:] @@ -14,7 +14,7 @@ Train LDA2Vec model ------------------- -.. code:: ipython3 +.. code:: python lda2vec = malaya.topic_model.lda2vec(corpus, 10) @@ -36,33 +36,33 @@ Train LDA2Vec model Print topics ^^^^^^^^^^^^ -.. code:: ipython3 +.. code:: python lda2vec.print_topics(5) .. parsed-literal:: - topic 0 topic 1 topic 2 topic 3 topic 4 - -------- -------- -------- -------- -------- - jahat fakta perinci selaras timbal - tabur intelek intelek tiket merosak - fakta pajak fakta intelek perinci - seru mewah puji digital samping - melenyapka minimum maruah kelas intelek - maruah kelas asa pajak mewah - indah butir suai jarang minimum - anggap atus tadbir ketua labur - misi ogos jelang celik catat - banding pesawat liow rancak giat - - + topic 0 topic 1 topic 2 topic 3 topic 4 + -------- -------- -------- -------- -------- + jahat fakta perinci selaras timbal + tabur intelek intelek tiket merosak + fakta pajak fakta intelek perinci + seru mewah puji digital samping + melenyapka minimum maruah kelas intelek + maruah kelas asa pajak mewah + indah butir suai jarang minimum + anggap atus tadbir ketua labur + misi ogos jelang celik catat + banding pesawat liow rancak giat + + Important sentences based on topics ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. code:: ipython3 +.. code:: python lda2vec.get_sentences(5) @@ -82,7 +82,7 @@ Important sentences based on topics Get topics ^^^^^^^^^^ -.. code:: ipython3 +.. code:: python lda2vec.get_topics(10) @@ -108,7 +108,7 @@ Get topics Visualize topics ^^^^^^^^^^^^^^^^ -.. code:: ipython3 +.. code:: python lda2vec.visualize_topics(notebook_mode = True) @@ -117,15 +117,15 @@ Visualize topics .. raw:: html - + - - + +