\n",
58 | "\n",
59 | "Please note that the `dynamic_topic_modeling` project is released with a\n",
60 | "[Contributor Code of\n",
61 | "Conduct](https://github.com/JiaxiangBU/dynamic_topic_modeling/blob/master/CODE_OF_CONDUCT.md). By\n",
62 | "contributing to this project, you agree to abide by its terms.\n",
63 | "\n",
64 | "
\n",
82 | "\n",
83 | "Blei, David M., and John D. Lafferty. 2006. “Dynamic Topic Models.” In\n",
84 | "*Machine Learning, Proceedings of the Twenty-Third International\n",
85 | "Conference (Icml 2006), Pittsburgh, Pennsylvania, Usa, June 25-29,\n",
86 | "2006*.\n",
87 | "\n",
88 | "
\n",
89 | "\n",
90 | "
"
91 | ]
92 | }
93 | ],
94 | "metadata": {
95 | "kernelspec": {
96 | "display_name": "Python 3",
97 | "language": "python",
98 | "name": "python3"
99 | },
100 | "language_info": {
101 | "codemirror_mode": {
102 | "name": "ipython",
103 | "version": 3
104 | },
105 | "file_extension": ".py",
106 | "mimetype": "text/x-python",
107 | "name": "python",
108 | "nbconvert_exporter": "python",
109 | "pygments_lexer": "ipython3",
110 | "version": "3.7.3"
111 | }
112 | },
113 | "nbformat": 4,
114 | "nbformat_minor": 2
115 | }
116 |
--------------------------------------------------------------------------------
/CITATION.bib:
--------------------------------------------------------------------------------
1 | @software{jiaxiang_li_2020_3660401,
2 | author = {Jiaxiang Li},
3 | title = {{JiaxiangBU/dynamic_topic_modeling:
4 | dynamic_topic_modeling 1.1.0}},
5 | month = feb,
6 | year = 2020,
7 | publisher = {Zenodo},
8 | version = {v1.1.0},
9 | doi = {10.5281/zenodo.3660401},
10 | url = {https://doi.org/10.5281/zenodo.3660401}
11 | }
12 |
--------------------------------------------------------------------------------
/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: dynamic_topic_modeling
2 | Version: 1.1.0
3 | Title: Run Dynamic Topic Modeling
4 | Description: What the package does (one paragraph).
5 | Authors@R:
6 | c(person(given = "Jiaxiang",
7 | family = "Li",
8 | role = c("aut", "cre"),
9 | email = "alex.lijiaxiang@foxmail.com",
10 | comment = c(ORCID = "https://orcid.org/0000-0003-3196-6492")),
11 | person(given = "Shuyi",
12 | family = "Wang",
13 | role = "aut"),
14 | person(given = "Svitlana",
15 | family = "Galeshchuk",
16 | role = "aut"))
17 | License: Apache License (>= 2.0)
18 | Encoding: UTF-8
19 | LazyData: true
20 | Roxygen: list(markdown = TRUE)
21 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Apache License
2 | ==============
3 |
4 | _Version 2.0, January 2004_
5 | _<>_
6 |
7 | ### Terms and Conditions for use, reproduction, and distribution
8 |
9 | #### 1. Definitions
10 |
11 | “License” shall mean the terms and conditions for use, reproduction, and
12 | distribution as defined by Sections 1 through 9 of this document.
13 |
14 | “Licensor” shall mean the copyright owner or entity authorized by the copyright
15 | owner that is granting the License.
16 |
17 | “Legal Entity” shall mean the union of the acting entity and all other entities
18 | that control, are controlled by, or are under common control with that entity.
19 | For the purposes of this definition, “control” means **(i)** the power, direct or
20 | indirect, to cause the direction or management of such entity, whether by
21 | contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
22 | outstanding shares, or **(iii)** beneficial ownership of such entity.
23 |
24 | “You” (or “Your”) shall mean an individual or Legal Entity exercising
25 | permissions granted by this License.
26 |
27 | “Source” form shall mean the preferred form for making modifications, including
28 | but not limited to software source code, documentation source, and configuration
29 | files.
30 |
31 | “Object” form shall mean any form resulting from mechanical transformation or
32 | translation of a Source form, including but not limited to compiled object code,
33 | generated documentation, and conversions to other media types.
34 |
35 | “Work” shall mean the work of authorship, whether in Source or Object form, made
36 | available under the License, as indicated by a copyright notice that is included
37 | in or attached to the work (an example is provided in the Appendix below).
38 |
39 | “Derivative Works” shall mean any work, whether in Source or Object form, that
40 | is based on (or derived from) the Work and for which the editorial revisions,
41 | annotations, elaborations, or other modifications represent, as a whole, an
42 | original work of authorship. For the purposes of this License, Derivative Works
43 | shall not include works that remain separable from, or merely link (or bind by
44 | name) to the interfaces of, the Work and Derivative Works thereof.
45 |
46 | “Contribution” shall mean any work of authorship, including the original version
47 | of the Work and any modifications or additions to that Work or Derivative Works
48 | thereof, that is intentionally submitted to Licensor for inclusion in the Work
49 | by the copyright owner or by an individual or Legal Entity authorized to submit
50 | on behalf of the copyright owner. For the purposes of this definition,
51 | “submitted” means any form of electronic, verbal, or written communication sent
52 | to the Licensor or its representatives, including but not limited to
53 | communication on electronic mailing lists, source code control systems, and
54 | issue tracking systems that are managed by, or on behalf of, the Licensor for
55 | the purpose of discussing and improving the Work, but excluding communication
56 | that is conspicuously marked or otherwise designated in writing by the copyright
57 | owner as “Not a Contribution.”
58 |
59 | “Contributor” shall mean Licensor and any individual or Legal Entity on behalf
60 | of whom a Contribution has been received by Licensor and subsequently
61 | incorporated within the Work.
62 |
63 | #### 2. Grant of Copyright License
64 |
65 | Subject to the terms and conditions of this License, each Contributor hereby
66 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
67 | irrevocable copyright license to reproduce, prepare Derivative Works of,
68 | publicly display, publicly perform, sublicense, and distribute the Work and such
69 | Derivative Works in Source or Object form.
70 |
71 | #### 3. Grant of Patent License
72 |
73 | Subject to the terms and conditions of this License, each Contributor hereby
74 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
75 | irrevocable (except as stated in this section) patent license to make, have
76 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where
77 | such license applies only to those patent claims licensable by such Contributor
78 | that are necessarily infringed by their Contribution(s) alone or by combination
79 | of their Contribution(s) with the Work to which such Contribution(s) was
80 | submitted. If You institute patent litigation against any entity (including a
81 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a
82 | Contribution incorporated within the Work constitutes direct or contributory
83 | patent infringement, then any patent licenses granted to You under this License
84 | for that Work shall terminate as of the date such litigation is filed.
85 |
86 | #### 4. Redistribution
87 |
88 | You may reproduce and distribute copies of the Work or Derivative Works thereof
89 | in any medium, with or without modifications, and in Source or Object form,
90 | provided that You meet the following conditions:
91 |
92 | * **(a)** You must give any other recipients of the Work or Derivative Works a copy of
93 | this License; and
94 | * **(b)** You must cause any modified files to carry prominent notices stating that You
95 | changed the files; and
96 | * **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
97 | all copyright, patent, trademark, and attribution notices from the Source form
98 | of the Work, excluding those notices that do not pertain to any part of the
99 | Derivative Works; and
100 | * **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
101 | Derivative Works that You distribute must include a readable copy of the
102 | attribution notices contained within such NOTICE file, excluding those notices
103 | that do not pertain to any part of the Derivative Works, in at least one of the
104 | following places: within a NOTICE text file distributed as part of the
105 | Derivative Works; within the Source form or documentation, if provided along
106 | with the Derivative Works; or, within a display generated by the Derivative
107 | Works, if and wherever such third-party notices normally appear. The contents of
108 | the NOTICE file are for informational purposes only and do not modify the
109 | License. You may add Your own attribution notices within Derivative Works that
110 | You distribute, alongside or as an addendum to the NOTICE text from the Work,
111 | provided that such additional attribution notices cannot be construed as
112 | modifying the License.
113 |
114 | You may add Your own copyright statement to Your modifications and may provide
115 | additional or different license terms and conditions for use, reproduction, or
116 | distribution of Your modifications, or for any such Derivative Works as a whole,
117 | provided Your use, reproduction, and distribution of the Work otherwise complies
118 | with the conditions stated in this License.
119 |
120 | #### 5. Submission of Contributions
121 |
122 | Unless You explicitly state otherwise, any Contribution intentionally submitted
123 | for inclusion in the Work by You to the Licensor shall be under the terms and
124 | conditions of this License, without any additional terms or conditions.
125 | Notwithstanding the above, nothing herein shall supersede or modify the terms of
126 | any separate license agreement you may have executed with Licensor regarding
127 | such Contributions.
128 |
129 | #### 6. Trademarks
130 |
131 | This License does not grant permission to use the trade names, trademarks,
132 | service marks, or product names of the Licensor, except as required for
133 | reasonable and customary use in describing the origin of the Work and
134 | reproducing the content of the NOTICE file.
135 |
136 | #### 7. Disclaimer of Warranty
137 |
138 | Unless required by applicable law or agreed to in writing, Licensor provides the
139 | Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
140 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
141 | including, without limitation, any warranties or conditions of TITLE,
142 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
143 | solely responsible for determining the appropriateness of using or
144 | redistributing the Work and assume any risks associated with Your exercise of
145 | permissions under this License.
146 |
147 | #### 8. Limitation of Liability
148 |
149 | In no event and under no legal theory, whether in tort (including negligence),
150 | contract, or otherwise, unless required by applicable law (such as deliberate
151 | and grossly negligent acts) or agreed to in writing, shall any Contributor be
152 | liable to You for damages, including any direct, indirect, special, incidental,
153 | or consequential damages of any character arising as a result of this License or
154 | out of the use or inability to use the Work (including but not limited to
155 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or
156 | any and all other commercial damages or losses), even if such Contributor has
157 | been advised of the possibility of such damages.
158 |
159 | #### 9. Accepting Warranty or Additional Liability
160 |
161 | While redistributing the Work or Derivative Works thereof, You may choose to
162 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or
163 | other liability obligations and/or rights consistent with this License. However,
164 | in accepting such obligations, You may act only on Your own behalf and on Your
165 | sole responsibility, not on behalf of any other Contributor, and only if You
166 | agree to indemnify, defend, and hold each Contributor harmless for any liability
167 | incurred by, or claims asserted against, such Contributor by reason of your
168 | accepting any such warranty or additional liability.
169 |
170 | _END OF TERMS AND CONDITIONS_
171 |
172 | ### APPENDIX: How to apply the Apache License to your work
173 |
174 | To apply the Apache License to your work, attach the following boilerplate
175 | notice, with the fields enclosed by brackets `[]` replaced with your own
176 | identifying information. (Don't include the brackets!) The text should be
177 | enclosed in the appropriate comment syntax for the file format. We also
178 | recommend that a file or class name and description of purpose be included on
179 | the same “printed page” as the copyright notice for easier identification within
180 | third-party archives.
181 |
182 | Copyright 2020 Jiaxiang Li
183 |
184 | Licensed under the Apache License, Version 2.0 (the "License");
185 | you may not use this file except in compliance with the License.
186 | You may obtain a copy of the License at
187 |
188 | http://www.apache.org/licenses/LICENSE-2.0
189 |
190 | Unless required by applicable law or agreed to in writing, software
191 | distributed under the License is distributed on an "AS IS" BASIS,
192 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
193 | See the License for the specific language governing permissions and
194 | limitations under the License.
195 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | README:
2 | Rscript analysis/build-README.R
3 |
4 | index1:
5 |
6 | RScript ../imp_rmd/update_index_content.R
7 |
8 | index2:
9 |
10 | notedown index.md > index.ipynb
11 | cp README-tmp.md README.md
12 | rm README-tmp.md
13 |
14 | push:
15 | Rscript analysis/push.R
16 |
17 | all: index push
18 |
--------------------------------------------------------------------------------
/NAMESPACE:
--------------------------------------------------------------------------------
1 | # Generated by roxygen2: fake comment so roxygen2 overwrites silently.
2 | exportPattern("^[^\\.]")
3 |
--------------------------------------------------------------------------------
/NEWS.md:
--------------------------------------------------------------------------------
1 | # dynamic.topic.modeling 1.1.0
2 |
3 | * Added a `NEWS.md` file to track changes to the package.
4 | * Add citations, and cited repositories.
5 | * Add title for each notebooks
6 | * Add the functions of 'display_topic', 'document_influence_dim', 'topic_distribution', 'visualize_topics', 'make_df'.
7 | * Update desc for release.
8 | * Update visualization for topic evolution
9 | 1. document the function of 'visualize_topics',
10 | 1. keep repo compact,
11 | 1. add rmd for visualization for topic evolutions,
12 | 1. update the word ones,
13 | 1. output the topic evolution figure,
14 | 1. update the word evolution figure,
15 | 1. update dtm model file,
16 | 1. update the dtm model data frame file,
17 | * Update the word evolution.
18 | * Finish topic evolution and outpput the result.
19 | * Finish the word evolution viz part.
20 | * Finish the function of 'display_topic', add the author of visualization parts, output the word distribution.
21 | * Update keywords.
22 | * Add pypi badge.
23 | * Update makefile
24 | * Update index.md, index.ipynb
25 | * Upload pacakges
26 | * Update readme with examples and references.
27 | * Update license, add settings.ini, setup.py, index.ipynb, and docs.
28 | * Add the file built for package.
29 | * Copy file from 'wei_lda_debate'
30 |
--------------------------------------------------------------------------------
/README.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | output: github_document
3 | bibliography: [../learn_nlp/refs/add.bib,refs/add.bib]
4 | ---
5 |
6 |
7 |
8 | ```{r, include = FALSE}
9 | knitr::opts_chunk$set(
10 | collapse = TRUE,
11 | comment = "#>",
12 | fig.path = "man/figures/README-",
13 | out.width = "100%"
14 | )
15 | ```
16 |
17 | # dynamic_topic_modeling
18 |
19 |
20 | [](https://badge.fury.io/py/dynamic-topic-modeling)
21 | [](https://zenodo.org/badge/latestdoi/238671296)
22 |
23 |
24 | Dynamic Topic Modeling (DTM)[@Blei2006Dynamic] is an advanced machine learning technique for uncovering the latent topics in a corpus of documents over time. The goal of this project is to provide an easy-to-use Python package for running DTM. This package is built on the frameworks of [sklearn](https://github.com/wshuyi/wei_lda_debate) and [gensim](https://github.com/GSukr/dtmvisual)[@Shuyi_Wang2018;@Svitlana_2019] for Dynamic Topic Modeling.
25 |
26 | To get started, follow the tutorials on our [Jupyter notebooks](https://nbviewer.jupyter.org/github/JiaxiangBU/dynamic_topic_modeling/tree/master/):
27 |
28 | 1. [LDA based on sklearn](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/sklearn-lda.ipynb)
29 | 2. [LDA based on gensim](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/gensim-lda.ipynb)
30 | 3. [Dynamic Topic Modeling](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/dtm.ipynb)
31 | 4. [Data Analysis on Demi Gods and Semi Devils using Dynamic Topic Modeling](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/demo.ipynb)
32 |
33 | ## Install
34 |
35 | `pip install dynamic_topic_modeling`
36 |
37 | ## Citations
38 |
39 |
40 | If you use dynamic_topic_modeling, please cite:
41 |
42 | Jiaxiang Li. (2020, February 9). JiaxiangBU/dynamic_topic_modeling: dynamic_topic_modeling 1.1.0 (Version v1.1.0). Zenodo. http://doi.org/10.5281/zenodo.3660401
43 |
44 | ```
45 | @software{jiaxiang_li_2020_3660401,
46 | author = {Jiaxiang Li},
47 | title = {{JiaxiangBU/dynamic_topic_modeling:
48 | dynamic_topic_modeling 1.1.0}},
49 | month = feb,
50 | year = 2020,
51 | publisher = {Zenodo},
52 | version = {v1.1.0},
53 | doi = {10.5281/zenodo.3660401},
54 | url = {https://doi.org/10.5281/zenodo.3660401}
55 | }
56 | ```
57 |
58 | `r add2pkg::add_disclaimer("Jiaxiang Li;Shuyi Wang;Svitlana Galeshchuk", license_name = "Apache License")`
59 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | # dynamic_topic_modeling
5 |
6 |
7 |
8 | [](https://badge.fury.io/py/dynamic-topic-modeling)
10 | [](https://zenodo.org/badge/latestdoi/238671296)
11 |
12 |
13 | Dynamic Topic Modeling (DTM)(Blei and Lafferty 2006) is an advanced
14 | machine learning technique for uncovering the latent topics in a corpus
15 | of documents over time. The goal of this project is to provide an
16 | easy-to-use Python package for running DTM. This package is built on the
17 | frameworks of [sklearn](https://github.com/wshuyi/wei_lda_debate) and
18 | [gensim](https://github.com/GSukr/dtmvisual)(Wang 2018; Svitlana 2019)
19 | for Dynamic Topic Modeling.
20 |
21 | To get started, follow the tutorials on our [Jupyter
22 | notebooks](https://nbviewer.jupyter.org/github/JiaxiangBU/dynamic_topic_modeling/tree/master/):
23 |
24 | 1. [LDA based on
25 | sklearn](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/sklearn-lda.ipynb)
26 | 2. [LDA based on
27 | gensim](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/gensim-lda.ipynb)
28 | 3. [Dynamic Topic
29 | Modeling](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/dtm.ipynb)
30 | 4. [Data Analysis on Demi Gods and Semi Devils using Dynamic Topic
31 | Modeling](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/demo.ipynb)
32 |
33 | ## Install
34 |
35 | `pip install dynamic_topic_modeling`
36 |
37 | ## Citations
38 |
39 | If you use dynamic_topic_modeling, please cite:
40 |
41 | Jiaxiang Li. (2020, February 9). JiaxiangBU/dynamic_topic_modeling:
42 | dynamic_topic_modeling 1.1.0 (Version v1.1.0). Zenodo.
43 |
44 |
45 | @software{jiaxiang_li_2020_3660401,
46 | author = {Jiaxiang Li},
47 | title = {{JiaxiangBU/dynamic_topic_modeling:
48 | dynamic_topic_modeling 1.1.0}},
49 | month = feb,
50 | year = 2020,
51 | publisher = {Zenodo},
52 | version = {v1.1.0},
53 | doi = {10.5281/zenodo.3660401},
54 | url = {https://doi.org/10.5281/zenodo.3660401}
55 | }
56 |
57 |
58 | **Code of Conduct**
59 |
60 |
61 | Please note that the `dynamic_topic_modeling` project is released with a
62 | [Contributor Code of
63 | Conduct](https://github.com/JiaxiangBU/dynamic_topic_modeling/blob/master/CODE_OF_CONDUCT.md). By
64 | contributing to this project, you agree to abide by its terms.
65 |
77 |
78 | Blei, David M., and John D. Lafferty. 2006. “Dynamic Topic Models.” In
79 | *Machine Learning, Proceedings of the Twenty-Third International
80 | Conference (ICML 2006), Pittsburgh, Pennsylvania, USA, June 25-29,
81 | 2006*.
82 |
83 |
84 |
85 |
86 |
87 | Svitlana. 2019. “Dtmvisual: This Package Consists of Functionalities for
88 | Dynamic Topic Modelling and Its Visualization.” GitHub. 2019.
89 | .
90 |
91 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/docs/js/customscripts.js:
--------------------------------------------------------------------------------
1 | $('#mysidebar').height($(".nav").height());
2 |
3 |
4 | $( document ).ready(function() {
5 |
6 | //this script says, if the height of the viewport is greater than 800px, then insert affix class, which makes the nav bar float in a fixed
7 | // position as your scroll. if you have a lot of nav items, this height may not work for you.
8 | var h = $(window).height();
9 | //console.log (h);
10 | if (h > 800) {
11 | $( "#mysidebar" ).attr("class", "nav affix");
12 | }
13 | // activate tooltips. although this is a bootstrap js function, it must be activated this way in your theme.
14 | $('[data-toggle="tooltip"]').tooltip({
15 | placement : 'top'
16 | });
17 |
18 | /**
19 | * AnchorJS
20 | */
21 | anchors.add('h2,h3,h4,h5');
22 |
23 | });
24 |
25 | // needed for nav tabs on pages. See Formatting > Nav tabs for more details.
26 | // script from http://stackoverflow.com/questions/10523433/how-do-i-keep-the-current-tab-active-with-twitter-bootstrap-after-a-page-reload
27 | $(function() {
28 | var json, tabsState;
29 | $('a[data-toggle="pill"], a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
30 | var href, json, parentId, tabsState;
31 |
32 | tabsState = localStorage.getItem("tabs-state");
33 | json = JSON.parse(tabsState || "{}");
34 | parentId = $(e.target).parents("ul.nav.nav-pills, ul.nav.nav-tabs").attr("id");
35 | href = $(e.target).attr('href');
36 | json[parentId] = href;
37 |
38 | return localStorage.setItem("tabs-state", JSON.stringify(json));
39 | });
40 |
41 | tabsState = localStorage.getItem("tabs-state");
42 | json = JSON.parse(tabsState || "{}");
43 |
44 | $.each(json, function(containerId, href) {
45 | return $("#" + containerId + " a[href=" + href + "]").tab('show');
46 | });
47 |
48 | $("ul.nav.nav-pills, ul.nav.nav-tabs").each(function() {
49 | var $this = $(this);
50 | if (!json[$this.attr("id")]) {
51 | return $this.find("a[data-toggle=tab]:first, a[data-toggle=pill]:first").tab("show");
52 | }
53 | });
54 | });
55 |
--------------------------------------------------------------------------------
/docs/js/jekyll-search.js:
--------------------------------------------------------------------------------
1 | !function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o=0}var self=this;self.matches=function(string,crit){return"string"!=typeof string?!1:(string=string.trim(),doMatch(string,crit))}}module.exports=new LiteralSearchStrategy},{}],4:[function(require,module){module.exports=function(){function findMatches(store,crit,strategy){for(var data=store.get(),i=0;i{title}',noResultsText:"No results found",limit:10,fuzzy:!1};self.init=function(_opt){validateOptions(_opt),assignOptions(_opt),isJSON(opt.dataSource)?initWithJSON(opt.dataSource):initWithURL(opt.dataSource)}}var Searcher=require("./Searcher"),Templater=require("./Templater"),Store=require("./Store"),JSONLoader=require("./JSONLoader"),searcher=new Searcher,templater=new Templater,store=new Store,jsonLoader=new JSONLoader;window.SimpleJekyllSearch=new SimpleJekyllSearch}(window,document)},{"./JSONLoader":1,"./Searcher":4,"./Store":5,"./Templater":6}]},{},[7]);
2 |
--------------------------------------------------------------------------------
/docs/js/jquery.ba-throttle-debounce.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery throttle / debounce - v1.1 - 3/7/2010
3 | * http://benalman.com/projects/jquery-throttle-debounce-plugin/
4 | *
5 | * Copyright (c) 2010 "Cowboy" Ben Alman
6 | * Dual licensed under the MIT and GPL licenses.
7 | * http://benalman.com/about/license/
8 | */
9 | (function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
--------------------------------------------------------------------------------
/docs/js/jquery.navgoco.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery Navgoco Menus Plugin v0.2.1 (2014-04-11)
3 | * https://github.com/tefra/navgoco
4 | *
5 | * Copyright (c) 2014 Chris T (@tefra)
6 | * BSD - https://github.com/tefra/navgoco/blob/master/LICENSE-BSD
7 | */
8 | !function(a){"use strict";var b=function(b,c,d){return this.el=b,this.$el=a(b),this.options=c,this.uuid=this.$el.attr("id")?this.$el.attr("id"):d,this.state={},this.init(),this};b.prototype={init:function(){var b=this;b._load(),b.$el.find("ul").each(function(c){var d=a(this);d.attr("data-index",c),b.options.save&&b.state.hasOwnProperty(c)?(d.parent().addClass(b.options.openClass),d.show()):d.parent().hasClass(b.options.openClass)?(d.show(),b.state[c]=1):d.hide()});var c=a("").prepend(b.options.caretHtml),d=b.$el.find("li > a");b._trigger(c,!1),b._trigger(d,!0),b.$el.find("li:has(ul) > a").prepend(c)},_trigger:function(b,c){var d=this;b.on("click",function(b){b.stopPropagation();var e=c?a(this).next():a(this).parent().next(),f=!1;if(c){var g=a(this).attr("href");f=void 0===g||""===g||"#"===g}if(e=e.length>0?e:!1,d.options.onClickBefore.call(this,b,e),!c||e&&f)b.preventDefault(),d._toggle(e,e.is(":hidden")),d._save();else if(d.options.accordion){var h=d.state=d._parents(a(this));d.$el.find("ul").filter(":visible").each(function(){var b=a(this),c=b.attr("data-index");h.hasOwnProperty(c)||d._toggle(b,!1)}),d._save()}d.options.onClickAfter.call(this,b,e)})},_toggle:function(b,c){var d=this,e=b.attr("data-index"),f=b.parent();if(d.options.onToggleBefore.call(this,b,c),c){if(f.addClass(d.options.openClass),b.slideDown(d.options.slide),d.state[e]=1,d.options.accordion){var g=d.state=d._parents(b);g[e]=d.state[e]=1,d.$el.find("ul").filter(":visible").each(function(){var b=a(this),c=b.attr("data-index");g.hasOwnProperty(c)||d._toggle(b,!1)})}}else f.removeClass(d.options.openClass),b.slideUp(d.options.slide),d.state[e]=0;d.options.onToggleAfter.call(this,b,c)},_parents:function(b,c){var d={},e=b.parent(),f=e.parents("ul");return f.each(function(){var b=a(this),e=b.attr("data-index");return e?void(d[e]=c?b:1):!1}),d},_save:function(){if(this.options.save){var b={};for(var d in this.state)1===this.state[d]&&(b[d]=1);c[this.uuid]=this.state=b,a.cookie(this.options.cookie.name,JSON.stringify(c),this.options.cookie)}},_load:function(){if(this.options.save){if(null===c){var b=a.cookie(this.options.cookie.name);c=b?JSON.parse(b):{}}this.state=c.hasOwnProperty(this.uuid)?c[this.uuid]:{}}},toggle:function(b){var c=this,d=arguments.length;if(1>=d)c.$el.find("ul").each(function(){var d=a(this);c._toggle(d,b)});else{var e,f={},g=Array.prototype.slice.call(arguments,1);d--;for(var h=0;d>h;h++){e=g[h];var i=c.$el.find('ul[data-index="'+e+'"]').first();if(i&&(f[e]=i,b)){var j=c._parents(i,!0);for(var k in j)f.hasOwnProperty(k)||(f[k]=j[k])}}for(e in f)c._toggle(f[e],b)}c._save()},destroy:function(){a.removeData(this.$el),this.$el.find("li:has(ul) > a").unbind("click"),this.$el.find("li:has(ul) > a > span").unbind("click")}},a.fn.navgoco=function(c){if("string"==typeof c&&"_"!==c.charAt(0)&&"init"!==c)var d=!0,e=Array.prototype.slice.call(arguments,1);else c=a.extend({},a.fn.navgoco.defaults,c||{}),a.cookie||(c.save=!1);return this.each(function(f){var g=a(this),h=g.data("navgoco");h||(h=new b(this,d?a.fn.navgoco.defaults:c,f),g.data("navgoco",h)),d&&h[c].apply(h,e)})};var c=null;a.fn.navgoco.defaults={caretHtml:"",accordion:!1,openClass:"open",save:!0,cookie:{name:"navgoco",expires:!1,path:"/"},slide:{duration:400,easing:"swing"},onClickBefore:a.noop,onClickAfter:a.noop,onToggleBefore:a.noop,onToggleAfter:a.noop}}(jQuery);
--------------------------------------------------------------------------------
/docs/js/toc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/ghiculescu/jekyll-table-of-contents
2 | // this library modified by fastai to:
3 | // - update the location.href with the correct anchor when a toc item is clicked on
4 | (function($){
5 | $.fn.toc = function(options) {
6 | var defaults = {
7 | noBackToTopLinks: false,
8 | title: '',
9 | minimumHeaders: 3,
10 | headers: 'h1, h2, h3, h4',
11 | listType: 'ol', // values: [ol|ul]
12 | showEffect: 'show', // values: [show|slideDown|fadeIn|none]
13 | showSpeed: 'slow' // set to 0 to deactivate effect
14 | },
15 | settings = $.extend(defaults, options);
16 |
17 | var headers = $(settings.headers).filter(function() {
18 | // get all headers with an ID
19 | var previousSiblingName = $(this).prev().attr( "name" );
20 | if (!this.id && previousSiblingName) {
21 | this.id = $(this).attr( "id", previousSiblingName.replace(/\./g, "-") );
22 | }
23 | return this.id;
24 | }), output = $(this);
25 | if (!headers.length || headers.length < settings.minimumHeaders || !output.length) {
26 | return;
27 | }
28 |
29 | if (0 === settings.showSpeed) {
30 | settings.showEffect = 'none';
31 | }
32 |
33 | var render = {
34 | show: function() { output.hide().html(html).show(settings.showSpeed); },
35 | slideDown: function() { output.hide().html(html).slideDown(settings.showSpeed); },
36 | fadeIn: function() { output.hide().html(html).fadeIn(settings.showSpeed); },
37 | none: function() { output.html(html); }
38 | };
39 |
40 | var get_level = function(ele) { return parseInt(ele.nodeName.replace("H", ""), 10); }
41 | var highest_level = headers.map(function(_, ele) { return get_level(ele); }).get().sort()[0];
42 | //var return_to_top = '';
43 | // other nice icons that can be used instead: glyphicon-upload glyphicon-hand-up glyphicon-chevron-up glyphicon-menu-up glyphicon-triangle-top
44 | var level = get_level(headers[0]),
45 | this_level,
46 | html = settings.title + " <"+settings.listType+">";
47 | headers.on('click', function() {
48 | if (!settings.noBackToTopLinks) {
49 | var pos = $(window).scrollTop();
50 | window.location.hash = this.id;
51 | $(window).scrollTop(pos);
52 | }
53 | })
54 | .addClass('clickable-header')
55 | .each(function(_, header) {
56 | base_url = window.location.href;
57 | base_url = base_url.replace(/#.*$/, "");
58 | this_level = get_level(header);
59 | //if (!settings.noBackToTopLinks && this_level > 1) {
60 | // $(header).addClass('top-level-header').before(return_to_top);
61 | //}
62 | txt = header.textContent.split('¶')[0].split(/\[(test|source)\]/)[0];
63 | if (!txt) {return;}
64 | if (this_level === level) // same level as before; same indenting
65 | html += "
" + txt + "";
66 | else if (this_level <= level){ // higher level than before; end parent ol
67 | for(i = this_level; i < level; i++) {
68 | html += "
"+settings.listType+">"
69 | }
70 | html += "
" + txt + "";
71 | }
72 | else if (this_level > level) { // lower level than before; expand the previous to contain a ol
73 | for(i = this_level; i > level; i--) {
74 | html += "<"+settings.listType+">"+((i-level == 2) ? "
" : "
")
75 | }
76 | html += "" + txt + "";
77 | }
78 | level = this_level; // update for the next one
79 | });
80 | html += ""+settings.listType+">";
81 | if (!settings.noBackToTopLinks) {
82 | $(document).on('click', '.back-to-top', function() {
83 | $(window).scrollTop(0);
84 | window.location.hash = '';
85 | });
86 | }
87 |
88 | render[settings.showEffect]();
89 | };
90 | })(jQuery);
91 |
--------------------------------------------------------------------------------
/docs/licenses/LICENSE:
--------------------------------------------------------------------------------
1 | /* This license pertains to the docs template, except for the Navgoco jQuery component. */
2 |
3 | The MIT License (MIT)
4 |
5 | Original theme: Copyright (c) 2016 Tom Johnson
6 | Modifications: Copyright (c) 2017 onwards fast.ai, Inc
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in all
16 | copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 |
--------------------------------------------------------------------------------
/docs/licenses/LICENSE-BSD-NAVGOCO.txt:
--------------------------------------------------------------------------------
1 | /* This license pertains to the Navgoco jQuery component used for the sidebar. */
2 |
3 | Copyright (c) 2013, Christodoulos Tsoulloftas, http://www.komposta.net
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without modification,
7 | are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice,
10 | this list of conditions and the following disclaimer.
11 | * Redistributions in binary form must reproduce the above copyright notice,
12 | this list of conditions and the following disclaimer in the documentation
13 | and/or other materials provided with the distribution.
14 | * Neither the name of the nor the names of its
15 | contributors may be used to endorse or promote products derived from this
16 | software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27 | OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/docs/sidebar.json:
--------------------------------------------------------------------------------
1 | {
2 | "dynamic_topic_modeling": {
3 | "Overview": "/",
4 | "Title": "/sklearn-lda"
5 | }
6 | }
--------------------------------------------------------------------------------
/docs/sitemap.xml:
--------------------------------------------------------------------------------
1 | ---
2 | layout: none
3 | search: exclude
4 | ---
5 |
6 |
7 |
8 | {% for post in site.posts %}
9 | {% unless post.search == "exclude" %}
10 |
11 | {{site.url}}{{post.url}}
12 |
13 | {% endunless %}
14 | {% endfor %}
15 |
16 |
17 | {% for page in site.pages %}
18 | {% unless page.search == "exclude" %}
19 |
20 | {{site.url}}{{ page.url}}
21 |
22 | {% endunless %}
23 | {% endfor %}
24 |
--------------------------------------------------------------------------------
/docs/sklearn-lda.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JiaxiangBU/dynamic_topic_modeling/96088bdc80938f0557b8561933c69e28a4fc20f3/docs/sklearn-lda.html
--------------------------------------------------------------------------------
/docs/tooltips.json:
--------------------------------------------------------------------------------
1 | ---
2 | layout: null
3 | search: exclude
4 | ---
5 |
6 | {
7 | "entries":
8 | [
9 | {% for page in site.tooltips %}
10 | {
11 | "doc_id": "{{ page.doc_id }}",
12 | "body": "{{ page.content | strip_newlines | replace: '\', '\\\\' | replace: '"', '\\"' }}"
13 | } {% unless forloop.last %},{% endunless %}
14 | {% endfor %}
15 | ]
16 | }
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/dynamic_topic_modeling.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 |
3 | RestoreWorkspace: No
4 | SaveWorkspace: No
5 | AlwaysSaveHistory: Default
6 |
7 | EnableCodeIndexing: Yes
8 | UseSpacesForTab: Yes
9 | NumSpacesForTab: 4
10 | Encoding: UTF-8
11 |
12 | RnwWeave: Sweave
13 | LaTeX: pdfLaTeX
14 |
15 | AutoAppendNewline: Yes
16 | StripTrailingWhitespace: Yes
17 |
18 | BuildType: Package
19 | PackageUseDevtools: Yes
20 | PackageInstallArgs: --no-multiarch --with-keep.source
21 | PackageRoxygenize: rd,collate,namespace
22 |
--------------------------------------------------------------------------------
/dynamic_topic_modeling.egg-info/PKG-INFO:
--------------------------------------------------------------------------------
1 | Metadata-Version: 2.1
2 | Name: dynamic-topic-modeling
3 | Version: 1.1.0
4 | Summary: Run dynamic topic modeling
5 | Home-page: https://github.com/JiaxiangBU/dynamic_topic_modeling
6 | Author: Jiaxiang Li and Shuyi Wang and Svitlana Galeshchuk
7 | Author-email: alex.lijiaxiang@foxmail.com
8 | License: Apache Software License 2.0
9 | Description:
10 | # dynamic_topic_modeling
11 |
12 | > Run dynamic topic modeling.
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | [](https://badge.fury.io/py/dynamic-topic-modeling)
22 | [](https://zenodo.org/badge/latestdoi/238671296)
23 |
24 |
25 | The goal of 'wei_lda_debate' is to build Latent Dirichlet Allocation
26 | models based on 'sklearn' and 'gensim' framework, and Dynamic Topic
27 | Model(Blei and Lafferty 2006) based on 'gensim' framework. I decide to
28 | build a Python package 'dynamic_topic_modeling', so this reposority
29 | will be updated and 'wei_lda_debate' is depreciated. The new
30 | reposority path is
31 | .
32 |
33 | To build this package, I borrow from
34 |
35 | 1. 'wei_lda_debate'(Wang 2018) to build LDA framework
36 | 2. 'dtmvisual'(Svitlana 2019) to build the visualization framework.
37 | Moreover, this package seems like a visualiztaion tutorial using
38 | jupyter notebook for 'dtmvisual'.
39 |
40 |
41 | 1. [LDA based on
42 | sklearn](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/sklearn-lda.ipynb)
43 | 2. [LDA based on
44 | gensim](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/gensim-lda.ipynb)
45 | 3. [Dynamic Topic
46 | Modeling](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/dtm.ipynb)
47 | 4. [Data Analysis on Demi Gods and Semi Devils using Dynamic Topic
48 | Modeling](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/demo.ipynb)
49 |
50 |
51 | Jiaxiang Li. (2020, February 9). JiaxiangBU/dynamic_topic_modeling:
52 | dynamic_topic_modeling 1.1.0 (Version v1.1.0). Zenodo.
53 |
54 |
55 |
56 | ```
57 | @software{jiaxiang_li_2020_3660401,
58 | author = {Jiaxiang Li},
59 | title = {{JiaxiangBU/dynamic_topic_modeling:
60 | dynamic_topic_modeling 1.1.0}},
61 | month = feb,
62 | year = 2020,
63 | publisher = {Zenodo},
64 | version = {v1.1.0},
65 | doi = {10.5281/zenodo.3660401},
66 | url = {https://doi.org/10.5281/zenodo.3660401}
67 | }
68 | ```
69 |
70 | If you use dynamic_topic_modeling, I would be very grateful if you can
71 | add a citation in your published work. By citing
72 | dynamic_topic_modeling, beyond acknowledging the work, you contribute
73 | to make it more visible and guarantee its growing and sustainability.
74 | For citation, please use the BibTex or the citation content.
75 |
76 |
77 | ## Install
78 |
79 | `pip install dynamic_topic_modeling`
80 |
81 | ## How to use
82 |
83 |
84 | 1. [LDA based on
85 | sklearn](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/sklearn-lda.ipynb)
86 | 2. [LDA based on
87 | gensim](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/gensim-lda.ipynb)
88 | 3. [Dynamic Topic
89 | Modeling](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/dtm.ipynb)
90 | 4. [Data Analysis on Demi Gods and Semi Devils using Dynamic Topic
91 | Modeling](https://nbviewer.jupyter.org/urls/jiaxiangbu.github.io/dynamic_topic_modeling/demo.ipynb)
92 |
93 |
94 | Jiaxiang Li. (2020, February 9). JiaxiangBU/dynamic\_topic\_modeling:
95 | dynamic\_topic\_modeling 1.1.0 (Version v1.1.0). Zenodo.
96 |
97 |
98 |
99 | ```
100 | @software{jiaxiang_li_2020_3660401,
101 | author = {Jiaxiang Li},
102 | title = {{JiaxiangBU/dynamic\_topic\_modeling:
103 | dynamic\_topic\_modeling 1.1.0}},
104 | month = feb,
105 | year = 2020,
106 | publisher = {Zenodo},
107 | version = {v1.1.0},
108 | doi = {10.5281/zenodo.3660401},
109 | url = {https://doi.org/10.5281/zenodo.3660401}
110 | }
111 | ```
112 |
113 | If you use dynamic\_topic\_modeling, I would be very grateful if you can
114 | add a citation in your published work. By citing
115 | dynamic\_topic\_modeling, beyond acknowledging the work, you contribute
116 | to make it more visible and guarantee its growing and sustainability.
117 | For citation, please use the BibTex or the citation content.
118 |
119 |
120 |
121 |
122 | **Code of Conduct**
123 |
124 |
125 |
126 |
127 |
128 | Please note that the `dynamic_topic_modeling` project is released with a
129 | [Contributor Code of
130 | Conduct](https://github.com/JiaxiangBU/dynamic_topic_modeling/blob/master/CODE_OF_CONDUCT.md). By
131 | contributing to this project, you agree to abide by its terms.
132 |
133 |
151 |
152 | Blei, David M., and John D. Lafferty. 2006. "Dynamic Topic Models." In
153 | *Machine Learning, Proceedings of the Twenty-Third International
154 | Conference (Icml 2006), Pittsburgh, Pennsylvania, Usa, June 25-29,
155 | 2006*.
156 |
157 |
158 |
159 |
160 |
161 | Svitlana. 2019. "Dtmvisual: This Package Consists of Functionalities for
162 | Dynamic Topic Modelling and Its Visualization." GitHub. 2019.
163 | .
164 |
165 |
\n",
156 | "\n",
157 | "Please note that the `dynamic_topic_modeling` project is released with a\n",
158 | "[Contributor Code of\n",
159 | "Conduct](https://github.com/JiaxiangBU/dynamic_topic_modeling/blob/master/CODE_OF_CONDUCT.md). By\n",
160 | "contributing to this project, you agree to abide by its terms.\n",
161 | "\n",
162 | "