gsukr / dtmvisual Goto Github PK
View Code? Open in Web Editor NEWThis package consists of functionalities for dynamic topic modelling and its visualization
This package consists of functionalities for dynamic topic modelling and its visualization
Dear GSukr,
I use your very good code to visualize time varying topics. I can see the changes in the top 10 words of each topic without any problems in figures. But this is not the case with the topics. Would you please kindly help me in this regard? The relevant code is as below:
import pandas
result = pandas.read_csv('../sample-data/sample1.csv', encoding='utf_8')
news_abstract = result['newsAbstract']
news_text_normal = result['textField_normal']
news_time = result['time_jalali']
import dtmvisual
time_seq = [100,150,150,100]
dtm_path = 'C:/Downloads/dtm-win64.exe'
from dtmvisual.gensim_corpus import docs_to_list, corpus_dtm
sentences = docs_to_list(news_abstract)
corpus = corpus_dtm(sentences)
from dtmvisual.DTMmodel import dtm_model
model = dtm_model(dtm_path, corpus, time_seq, num_topics=8,
id2word=corpus.dictionary, alpha=0.01)
number_of_timespans = 4
number_of_topics = 8
from dtmvisual import visualize_words
df = visualize_words.DF(number_of_timespans, number_of_topics, model)
d = visualize_words.partitioning(df)
visualize_words.visualize_words(df, d)
#--------Topics evolution------
from dtmvisual import VisualizeTopics
df = VisualizeTopics.topic_distribution(number_of_topics, model, time_seq)
VisualizeTopics.visualize_topics(df)
'''
#Moreover, you save and then download your DTM model using:
dtmvisual.save_model(model, output_path, output_name)
model = dtmvisual.load_saved_model(output_path, output_name)
#To print the words for a timeslice for a topic use:
'''
from dtmvisual import DTMmodel
DTMmodel.print_all_topics(model, topicid = 7, time = 4, num_words=10)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.