Topic Modelling- Deep Learning Interview Questions
Topic Modelling- Deep Learning Interview Questions
Project Overview:
The objective of this project was to analyze a dataset related to deep learning interview questions using various natural language
processing (NLP) techniques.
Steps Involved:
1. Data Collection:
Applied Latent Dirichlet Allocation (LDA) to extract topics from the dataset.
Identified dominant topics in the dataset and the most representative words for each topic.
Visualized topics using word clouds and bar charts to understand word distributions.
4. Analysis and Interpretation:
Discovered surprising connections between seemingly universal terms that fit with any machine learning model related
questions.
Investigated the prevalence of certain terms (like 'LSTM', 'GRU', 'CNN') through probabilistic analysis.
Explored how certain words held higher significance than expected in discussions around deep learning models.
5. Visualization Techniques Used:
Word Clouds: Created word clouds to visually represent the most frequent words in topics.
Bar Charts: Displayed the frequency of top words for each topic.
Histograms: Plotted histograms to show the frequency of words in the dataset.
6. Insights Derived:
Explored the interconnectedness of terms and the evolving trends within the deep learning landscape.
Acknowledged the significance of staying updated with the latest advancements to excel in the field of AI and deep learning.
Conclusion:
The project provided valuable insights into the nuances of deep learning discussions and the essentiality of comprehending both
fundamental concepts and cutting-edge technologies. The analysis highlighted unexpected connections between terms and the emphasis
on certain advanced technologies, driving the importance of continuous learning and adaptation in the dynamic field of AI and deep
learning.
Throughout this project, various NLP techniques and visualization methods were employed to understand the dataset, revealing intriguing
patterns and relationships among words and topics in deep learning discussions.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import os
import sys
from google.colab import files
import pandas as pd
import io
import spacy
import string
from collections import Counter
import pandas as pd
from transformers import pipeline
from gensim.corpora import Dictionary
from gensim.models import LdaModel
import re
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.collocations import BigramAssocMeasures, TrigramAssocMeasures, BigramCollocationFinder, TrigramCollocationF
from gensim.corpora import Dictionary
from gensim.models import LdaModel
import re
uploaded = files.upload()
Choose Files No file selected Upload widget is only available when the cell has been executed in the
data = pd.read_csv('deeplearning_questions.csv')
data.shape
(111, 2)
data.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 111 entries, 0 to 110
Data columns (total 2 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 ID 111 non-null int64
1 DESCRIPTION 111 non-null object
dtypes: int64(1), object(1)
memory usage: 1.9+ KB
nltk.download('punkt')
nltk.download('stopwords')
documents = data['DESCRIPTION'].tolist()
def preprocess_text(text):
# Lowercasing all the words
text = text.lower()
text = re.sub(r'[^\w\s]', '', text)
text = re.sub(r'\d+', '', text)
stop_words = set(stopwords.words('english'))
words = text.split()
filtered_words = [word for word in words if word not in stop_words]
text = ' '.join(filtered_words)
return text
In tasks where understanding the semantic meaning of sentences or phrases is crucial, removing stopwords might helpful. Stopwords
often don't contribute much to the context or meaning of a sentence, so removing them might help in focusing on more meaningful words.
For tasks like topic modeling where the goal is to identify key themes or topics within a corpus, removing stopwords can be useful. These
words are commonly occurring and might not contribute significantly to topic identification. In tokenization processes where individual
words or phrases are extracted, stopwords might be filtered out to maintain a cleaner set of tokens.
padding
sigmoid vs softmax
pos tagging
tokenization
topic modeling
back propagation
idea behind gans
computational graph
sigmoid
namedentity recognition
explain masked language model
preprocess text nlp
extract features nlp
wordvec different glove
different layers cnn
makes cnns translation invariant
fasttext different wordvec
explain generative adversarial network
backward forward propagation
syntactic semantic analysis
local optimumwhat local optimum
explain gates used lstm functions
relu better sigmoid tanh
transfer learning used
multitask learning used
difference convex nonconvex cost function
remove stop words remove
explain difference epoch batch iteration
difference nlp nlu
online learning one would prefer sgd adagrad
multilayer perceptron mlpwhat multilayer perceptron mlp
always bad local optimais always bad local optima
nodevec embedding represent topological similarity nearness
understand boltzmann machine restricted boltzmann machines
compute inverse matrix faster playing around computational tricks
infrequentrare words among cbow skipgram used wordvec training
pooling cnn need
describe structure artificial neural networks rnnrecurrent neural network
select batch size selecting batch size produce better worse results
ngrams use
large n bag words using ngrams
use neural nets text classification computer vision
gradient descent methods always converge point
gradient descent work
autoencoders explain different layers autoencoders mention three practical usages
vanishing gradient descent
difference vanishing gradient vs exploding gradient
handle dying node problems case relu activation function
use leaky relu function
different deep learning frameworks
difference machine learning deep learning
dropout layer help neural network
explain dropout neural network acts regularizer
know whether model suffering problem exploding gradients
handle exploding gradient problem
lstm network work
problem bilstm solve instead lstm
difference lstm gru
happens predictions cnn image rotated
cnn help translation rotation invariance images
define term freuency inverse document freuency tfidf use converting text vector
three primary convolutional neural network layers commonly put together
describe architecture typical convolutional neural network
mean dropout batch normalization use
difference online batch learning
dropout used test set
activation function discuss use activation function
explain three different types activation functions
range activation functions
rectified linear unit good activation function
dont use relu activation function output layer
go wrong use linear activation instead relu
give examples manytoone rnn architecture appropriate give examples manytoone rnn architecture appropriate
rnn rnn work
sigmoid tanh preferred used activation function hidden layer neural network
difference various activation functions sigmoid tanh softmax relu leaky relu
tanh activation function preferred sigmoid
word embeddings useful
wordvec
advantages using character embeddings instead word embeddings
get sentence meanings word embeddings considering position words sentence
would prefer gradient boosting trees model logistic regression text classification bag words
bag words use text vectorization
advantages disadvantages bag words
main difference adam sgd
advantages disadvantages sgd gradient descent
difference stochastic gradient descent sgd gradient descent gd batch gradient descent stochastic gradient desce
nt minibatch gradient descent pros cons
would use gd sdg viceversa
would choose number filters filter size cnn layer
use cnn text classification
advantages using cnn convolutional neural network rather dnn dense neural network image classification task
describe two ways visualize features cnn image classification task
segmentation cnns typically encoderdecoder style structure
convolutional layer actually need convolutions use fullyconnected layers
advantages parameter sharing case convolution
use convolutions images rather fully connected layers
would use many small convolutional kernels x rather large oneswhy would use many small convolutional kernels x
rather large ones
generally use softmax nonlinearity function last operation innetwork
batchnormalization differ training inferencing
batch size affect training neural networks
using mini batch gradient descent important shuffle data
give simple mathematical argument minibatch version ml algorithm might computationally efficient training full
data set
simplified fundamental scale makes newly developed bert model better traditional nlp models
would initialize weights neural network
weights initialized small random numbers neural network happens weights constant values
suppose nn layers relu activations happen initialize weights value
backpropagation work need
large filter sizes early layers bad choice choose filter size
one powerful layer decision tree layer neural network without activation function hint nonlinearity
decision trees deep neural networks nonlinear classifier ie separates space complicated decision boundary much
easier us intuitively follow decision tree model vs deep neural network
could take advantage multiple cpu cores would prefer boostedtree algorithm random forest
0 [padding]
1 [sigmoid, vs, softmax]
2 [pos, tagging]
3 [tokenization]
4 [topic, modeling]
5 [back, propagation]
6 [idea, behind, gans]
7 [computational, graph]
8 [sigmoid]
9 [namedentity, recognition]
10 [explain, masked, language, model]
11 [preprocess, text, nlp]
12 [extract, features, nlp]
13 [wordvec, different, glove]
14 [different, layers, cnn]
15 [makes, cnns, translation, invariant]
16 [fasttext, different, wordvec]
17 [explain, generative, adversarial, network]
18 [backward, forward, propagation]
19 [syntactic, semantic, analysis]
dtype: object
bigram_measures = BigramAssocMeasures()
trigram_measures = TrigramAssocMeasures()
bigram_finder = BigramCollocationFinder.from_documents(tokenized_docs)
trigram_finder = TrigramCollocationFinder.from_documents(tokenized_docs)
<nltk.collocations.BigramCollocationFinder at 0x7ccc38578670>
bigram_finder, trigram_finder
(<nltk.collocations.BigramCollocationFinder at 0x7ccc38578670>,
<nltk.collocations.TrigramCollocationFinder at 0x7ccc38579cf0>)
Top 10 Bigrams: [('activations', 'happen'), ('acts', 'regularizer'), ('advantage', 'multiple'), ('among', 'cbow
'), ('backward', 'forward'), ('batchnormalization', 'differ'), ('behind', 'gans'), ('bilstm', 'solve'), ('bound
ary', 'much'), ('cbow', 'skipgram')]
Top 10 Trigrams: [('advantage', 'multiple', 'cpu'), ('among', 'cbow', 'skipgram'), ('boundary', 'much', 'easi
er'), ('classifier', 'ie', 'separates'), ('commonly', 'put', 'together'), ('convex', 'nonconvex', 'cost'), ('co
uld', 'take', 'advantage'), ('dying', 'node', 'problems'), ('easier', 'us', 'intuitively'), ('embedding', 'repr
esent', 'topological')]
Filtered Top Trigrams: [('advantage', 'multiple', 'cpu'), ('among', 'cbow', 'skipgram'), ('boundary', 'much', '
easier'), ('classifier', 'ie', 'separates'), ('commonly', 'put', 'together'), ('convex', 'nonconvex', 'cost'),
('could', 'take', 'advantage'), ('dying', 'node', 'problems'), ('easier', 'us', 'intuitively'), ('embedding', '
represent', 'topological'), ('faster', 'playing', 'around'), ('idea', 'behind', 'gans'), ('ie', 'separates', 's
pace'), ('last', 'operation', 'innetwork'), ('matrix', 'faster', 'playing'), ('might', 'computationally', 'effi
cient'), ('much', 'easier', 'us'), ('multiple', 'cpu', 'cores'), ('newly', 'developed', 'bert'), ('nodevec', 'e
mbedding', 'represent'), ('nonlinear', 'classifier', 'ie'), ('represent', 'topological', 'similarity'), ('separ
ates', 'space', 'complicated'), ('simple', 'mathematical', 'argument'), ('simplified', 'fundamental', 'scale'),
('syntactic', 'semantic', 'analysis'), ('take', 'advantage', 'multiple'), ('topological', 'similarity', 'nearne
ss'), ('two', 'ways', 'visualize'), ('typically', 'encoderdecoder', 'style'), ('us', 'intuitively', 'follow'),
('activations', 'happen', 'initialize'), ('algorithm', 'might', 'computationally'), ('argument', 'minibatch', '
version'), ('around', 'computational', 'tricks'), ('backward', 'forward', 'propagation'), ('choose', 'number',
'filters'), ('cnns', 'typically', 'encoderdecoder'), ('compute', 'inverse', 'matrix'), ('define', 'term', 'freu
ency'), ('document', 'freuency', 'tfidf'), ('encoderdecoder', 'style', 'structure'), ('fundamental', 'scale', '
makes'), ('gd', 'sdg', 'viceversa'), ('get', 'sentence', 'meanings'), ('handle', 'dying', 'node'), ('important'
, 'shuffle', 'data'), ('inverse', 'matrix', 'faster'), ('linear', 'unit', 'good'), ('makes', 'newly', 'develope
d'), ('mathematical', 'argument', 'minibatch'), ('minibatch', 'version', 'ml'), ('ml', 'algorithm', 'might'), (
'node', 'problems', 'case'), ('parameter', 'sharing', 'case'), ('playing', 'around', 'computational'), ('rectif
ied', 'linear', 'unit'), ('restricted', 'boltzmann', 'machines'), ('rotation', 'invariance', 'images'), ('scale
', 'makes', 'newly'), ('segmentation', 'cnns', 'typically'), ('sharing', 'case', 'convolution'), ('translation'
, 'rotation', 'invariance'), ('version', 'ml', 'algorithm'), ('ways', 'visualize', 'features'), ('always', 'con
verge', 'point'), ('better', 'worse', 'results'), ('bilstm', 'solve', 'instead'), ('describe', 'two', 'ways'),
('filter', 'sizes', 'early'), ('give', 'simple', 'mathematical'), ('mention', 'three', 'practical'), ('methods'
, 'always', 'converge'), ('networks', 'nonlinear', 'classifier'), ('number', 'filters', 'filter'), ('problem',
'bilstm', 'solve'), ('produce', 'better', 'worse'), ('three', 'practical', 'usages'), ('algorithm', 'random', '
forest'), ('batchnormalization', 'differ', 'training'), ('boltzmann', 'machine', 'restricted'), ('boostedtree',
'algorithm', 'random'), ('cnns', 'translation', 'invariant'), ('complicated', 'decision', 'boundary'), ('comput
ationally', 'efficient', 'training'), ('decision', 'boundary', 'much'), ('differ', 'training', 'inferencing'),
('efficient', 'training', 'full'), ('embeddings', 'considering', 'position'), ('freuency', 'inverse', 'document
'), ('full', 'data', 'set'), ('help', 'translation', 'rotation'), ('intuitively', 'follow', 'decision'), ('inve
rse', 'document', 'freuency'), ('machine', 'restricted', 'boltzmann'), ('mlpwhat', 'multilayer', 'perceptron'),
('multilayer', 'perceptron', 'mlp'), ('multilayer', 'perceptron', 'mlpwhat'), ('optimumwhat', 'local', 'optimum
'), ('perceptron', 'mlpwhat', 'multilayer'), ('rather', 'dnn', 'dense'), ('rather', 'fully', 'connected'), ('sp
ace', 'complicated', 'decision'), ('term', 'freuency', 'inverse'), ('traditional', 'nlp', 'models'), ('understa
nd', 'boltzmann', 'machine'), ('weights', 'constant', 'values'), ('advantages', 'parameter', 'sharing'), ('clas
sification', 'computer', 'vision'), ('developed', 'bert', 'model'), ('know', 'whether', 'model'), ('masked', 'l
anguage', 'model'), ('model', 'logistic', 'regression'), ('whether', 'model', 'suffering'), ('actually', 'need'
, 'convolutions'), ('autoencoders', 'mention', 'three'), ('bad', 'choice', 'choose'), ('cbow', 'skipgram', 'use
d'), ('choice', 'choose', 'filter'), ('converting', 'text', 'vector'), ('describe', 'structure', 'artificial'),
('give', 'examples', 'manytoone'), ('initialized', 'small', 'random'), ('logistic', 'regression', 'text'), ('pr
efer', 'boostedtree', 'algorithm'), ('sentence', 'meanings', 'word'), ('small', 'random', 'numbers'), ('conside
ring', 'position', 'words'), ('explain', 'generative', 'adversarial'), ('explain', 'masked', 'language'), ('ful
ly', 'connected', 'layers'), ('infrequentrare', 'words', 'among'), ('layers', 'commonly', 'put'), ('sizes', 'ea
rly', 'layers'), ('suppose', 'nn', 'layers'), ('words', 'among', 'cbow'), ('cpu', 'cores', 'would'), ('epoch',
'batch', 'iteration'), ('examples', 'manytoone', 'rnn'), ('extract', 'features', 'nlp'), ('follow', 'decision',
'tree'), ('happen', 'initialize', 'weights'), ('happens', 'weights', 'constant'), ('images', 'rather', 'fully')
, ('initialize', 'weights', 'value'), ('kernels', 'x', 'rather'), ('makes', 'cnns', 'translation'), ('relu', 'a
ctivations', 'happen'), ('training', 'full', 'data'), ('describe', 'architecture', 'typical'), ('optimais', 'al
ways', 'bad'), ('problem', 'exploding', 'gradients'), ('suffering', 'problem', 'exploding'), ('boosting', 'tree
s', 'model'), ('descent', 'important', 'shuffle'), ('descent', 'pros', 'cons'), ('difference', 'convex', 'nonco
nvex'), ('main', 'difference', 'adam'), ('trees', 'model', 'logistic'), ('function', 'last', 'operation'), ('no
nconvex', 'cost', 'function'), ('appropriate', 'give', 'examples'), ('backpropagation', 'work', 'need'), ('bad'
, 'local', 'optima'), ('bad', 'local', 'optimais'), ('better', 'traditional', 'nlp'), ('character', 'embeddings
', 'instead'), ('convolutional', 'kernels', 'x'), ('large', 'filter', 'sizes'), ('local', 'optimais', 'always')
, ('manytoone', 'rnn', 'architecture'), ('meanings', 'word', 'embeddings'), ('prefer', 'sgd', 'adagrad'), ('rnn
', 'architecture', 'appropriate'), ('solve', 'instead', 'lstm'), ('unit', 'good', 'activation'), ('used', 'test
', 'set'), ('weights', 'initialized', 'small'), ('word', 'embeddings', 'considering'), ('word', 'embeddings', '
useful'), ('generative', 'adversarial', 'network'), ('layers', 'autoencoders', 'mention'), ('network', 'acts',
'regularizer'), ('one', 'powerful', 'layer'), ('position', 'words', 'sentence'), ('remove', 'stop', 'words'), (
'stop', 'words', 'remove'), ('bert', 'model', 'better'), ('filters', 'filter', 'size'), ('image', 'classificati
on', 'task'), ('model', 'better', 'traditional'), ('model', 'suffering', 'problem'), ('size', 'produce', 'bette
r'), ('convolutions', 'images', 'rather'), ('dnn', 'dense', 'neural'), ('go', 'wrong', 'use'), ('happens', 'pre
dictions', 'cnn'), ('large', 'n', 'bag'), ('local', 'optimumwhat', 'local'), ('problems', 'case', 'relu'), ('ra
ther', 'large', 'ones'), ('rather', 'large', 'oneswhy'), ('tfidf', 'use', 'converting'), ('using', 'character',
'embeddings'), ('visualize', 'features', 'cnn'), ('would', 'choose', 'number'), ('x', 'rather', 'large'), ('alw
ays', 'bad', 'local'), ('architecture', 'appropriate', 'give'), ('architecture', 'typical', 'convolutional'), (
'many', 'small', 'convolutional'), ('small', 'convolutional', 'kernels'), ('three', 'different', 'types'), ('th
ree', 'primary', 'convolutional'), ('advantages', 'using', 'character'), ('size', 'affect', 'training'), ('earl
y', 'layers', 'bad'), ('layer', 'actually', 'need'), ('layers', 'bad', 'choice'), ('function', 'hint', 'nonline
arity'), ('nonlinearity', 'function', 'last'), ('cnn', 'image', 'rotated'), ('cores', 'would', 'prefer'), ('dro
pout', 'used', 'test'), ('fasttext', 'different', 'wordvec'), ('gates', 'used', 'lstm'), ('pooling', 'cnn', 'ne
ed'), ('predictions', 'cnn', 'image'), ('preprocess', 'text', 'nlp'), ('skipgram', 'used', 'wordvec'), ('wordve
c', 'different', 'glove'), ('would', 'prefer', 'boostedtree'), ('deep', 'learning', 'frameworks'), ('gradient',
'boosting', 'trees'), ('n', 'bag', 'words'), ('online', 'learning', 'one'), ('powerful', 'layer', 'decision'),
('choose', 'filter', 'size'), ('descent', 'methods', 'always'), ('nets', 'text', 'classification'), ('regressio
n', 'text', 'classification'), ('text', 'classification', 'computer'), ('tree', 'model', 'vs'), ('cnn', 'help',
'translation'), ('convolutions', 'use', 'fullyconnected'), ('decision', 'trees', 'deep'), ('dropout', 'batch',
'normalization'), ('freuency', 'tfidf', 'use'), ('large', 'oneswhy', 'would'), ('mean', 'dropout', 'batch'), ('
random', 'numbers', 'neural'), ('structure', 'artificial', 'neural'), ('use', 'gd', 'sdg'), ('using', 'mini', '
batch'), ('wrong', 'use', 'linear'), ('embeddings', 'instead', 'word'), ('instead', 'word', 'embeddings'), ('ad
vantages', 'disadvantages', 'bag'), ('advantages', 'disadvantages', 'sgd'), ('batch', 'size', 'affect'), ('batc
h', 'size', 'produce'), ('batch', 'size', 'selecting'), ('decision', 'tree', 'model'), ('difference', 'adam', '
sgd'), ('difference', 'lstm', 'gru'), ('difference', 'nlp', 'nlu'), ('select', 'batch', 'size'), ('selecting',
'batch', 'size'), ('size', 'selecting', 'batch'), ('convolutional', 'layer', 'actually'), ('explain', 'gates',
'used'), ('multitask', 'learning', 'used'), ('prefer', 'gradient', 'boosting'), ('transfer', 'learning', 'used'
), ('artificial', 'neural', 'networks'), ('features', 'cnn', 'image'), ('generally', 'use', 'softmax'), ('netwo
rks', 'rnnrecurrent', 'neural'), ('neural', 'networks', 'nonlinear'), ('neural', 'networks', 'rnnrecurrent'), (
'one', 'would', 'prefer'), ('range', 'activation', 'functions'), ('sigmoid', 'tanh', 'preferred'), ('softmax',
'relu', 'leaky'), ('tanh', 'preferred', 'used'), ('types', 'activation', 'functions'), ('use', 'many', 'small')
, ('various', 'activation', 'functions'), ('sigmoid', 'vs', 'softmax'), ('decision', 'tree', 'layer'), ('disadv
antages', 'bag', 'words'), ('dropout', 'layer', 'help'), ('layer', 'decision', 'tree'), ('layers', 'relu', 'act
ivations'), ('machine', 'learning', 'deep'), ('network', 'rather', 'dnn'), ('nn', 'layers', 'relu'), ('words',
'using', 'ngrams'), ('model', 'vs', 'deep'), ('affect', 'training', 'neural'), ('rnn', 'rnn', 'work'), ('use',
'convolutions', 'images'), ('would', 'initialize', 'weights'), ('softmax', 'nonlinearity', 'function'), ('expla
in', 'difference', 'epoch'), ('better', 'sigmoid', 'tanh'), ('different', 'types', 'activation'), ('linear', 'a
ctivation', 'instead'), ('sigmoid', 'tanh', 'softmax'), ('function', 'hidden', 'layer'), ('function', 'output',
'layer'), ('difference', 'epoch', 'batch'), ('autoencoders', 'explain', 'different'), ('different', 'layers', '
autoencoders'), ('handle', 'exploding', 'gradient'), ('vanishing', 'gradient', 'vs'), ('functions', 'sigmoid',
'tanh'), ('need', 'convolutions', 'use'), ('neural', 'nets', 'text'), ('primary', 'convolutional', 'neural'), (
'tanh', 'softmax', 'relu'), ('typical', 'convolutional', 'neural'), ('use', 'converting', 'text'), ('use', 'sof
tmax', 'nonlinearity'), ('use', 'text', 'vectorization'), ('used', 'lstm', 'functions'), ('used', 'wordvec', 't
raining'), ('would', 'prefer', 'sgd'), ('network', 'layers', 'commonly'), ('bag', 'words', 'using'), ('disadvan
tages', 'sgd', 'gradient'), ('hidden', 'layer', 'neural'), ('learning', 'one', 'would'), ('mini', 'batch', 'gra
dient'), ('network', 'happens', 'weights'), ('online', 'batch', 'learning'), ('use', 'fullyconnected', 'layers'
), ('cnn', 'image', 'classification'), ('difference', 'various', 'activation'), ('filter', 'size', 'cnn'), ('te
xt', 'classification', 'bag'), ('explain', 'three', 'different'), ('exploding', 'gradient', 'problem'), ('gradi
ent', 'vs', 'exploding'), ('vs', 'exploding', 'gradient'), ('batch', 'normalization', 'use'), ('dont', 'use', '
relu'), ('initialize', 'weights', 'neural'), ('oneswhy', 'would', 'use'), ('relu', 'leaky', 'relu'), ('trees',
'deep', 'neural'), ('would', 'use', 'many'), ('activation', 'function', 'discuss'), ('activation', 'function',
'hidden'), ('activation', 'function', 'hint'), ('activation', 'function', 'output'), ('function', 'preferred',
'sigmoid'), ('good', 'activation', 'function'), ('without', 'activation', 'function'), ('classification', 'bag'
, 'words'), ('difference', 'machine', 'learning'), ('gradient', 'descent', 'important'), ('gradient', 'descent'
, 'methods'), ('gradient', 'descent', 'pros'), ('stochastic', 'gradient', 'descent'), ('preferred', 'used', 'ac
tivation'), ('relu', 'better', 'sigmoid'), ('advantages', 'using', 'cnn'), ('descent', 'gd', 'batch'), ('differ
ence', 'online', 'batch'), ('different', 'deep', 'learning'), ('network', 'without', 'activation'), ('function'
, 'discuss', 'use'), ('leaky', 'relu', 'function'), ('case', 'relu', 'activation'), ('deep', 'neural', 'network
s'), ('discuss', 'use', 'activation'), ('training', 'neural', 'networks'), ('using', 'cnn', 'convolutional'), (
'vs', 'deep', 'neural'), ('learning', 'deep', 'learning'), ('network', 'image', 'classification'), ('dense', 'n
eural', 'network'), ('gd', 'batch', 'gradient'), ('layer', 'help', 'neural'), ('lstm', 'network', 'work'), ('ne
ural', 'network', 'acts'), ('neural', 'network', 'without'), ('numbers', 'neural', 'network'), ('rnnrecurrent',
'neural', 'network'), ('tree', 'layer', 'neural'), ('cnn', 'text', 'classification'), ('use', 'leaky', 'relu'),
('use', 'neural', 'nets'), ('would', 'use', 'gd'), ('activation', 'function', 'preferred'), ('descent', 'miniba
tch', 'gradient'), ('descent', 'stochastic', 'gradient'), ('difference', 'stochastic', 'gradient'), ('differenc
e', 'vanishing', 'gradient'), ('gradient', 'descent', 'gd'), ('gradient', 'descent', 'minibatch'), ('gradient',
'descent', 'stochastic'), ('minibatch', 'gradient', 'descent'), ('sgd', 'gradient', 'descent'), ('size', 'cnn',
'layer'), ('vanishing', 'gradient', 'descent'), ('activation', 'functions', 'sigmoid'), ('activation', 'instead
', 'relu'), ('explain', 'different', 'layers'), ('different', 'layers', 'cnn'), ('would', 'prefer', 'gradient')
, ('use', 'linear', 'activation')]
tokenized_docs_with_multi_tokens = []
else:
doc_with_multi_tokens.extend(token.split())
tokenized_docs_with_multi_tokens.append(doc_with_multi_tokens)
print(dictionary)
[[],
[(0, 1), (1, 1), (2, 1)],
[],
[],
[],
[(3, 1)],
[],
[(4, 1)],
[(0, 1)],
[],
[(5, 1), (6, 1)],
[(7, 1), (8, 1)],
[(7, 1), (9, 1)],
[(10, 1), (11, 1)],
[(10, 1), (12, 1), (13, 1)],
[(14, 1), (15, 1), (16, 1)],
[(10, 1), (11, 1)],
[(5, 1), (17, 1)],
[(3, 1)],
[],
[(18, 2)],
[(5, 1), (19, 1), (20, 1), (21, 1)],
[(0, 1), (22, 1), (23, 1), (24, 1)],
[(21, 1), (25, 1)],
[(21, 1), (25, 1)],
[(26, 1), (27, 1)],
[(28, 1)],
[(5, 1), (26, 1), (29, 1)],
[(7, 1), (26, 1)],
[(25, 1), (30, 1), (31, 1), (32, 1), (33, 1), (34, 1)],
[],
[(18, 2), (35, 2), (36, 2)],
[],
[(37, 1)],
[(4, 1), (38, 1)],
[(11, 1), (21, 1), (28, 1), (39, 1)],
[(12, 1), (40, 1)],
[(17, 1), (41, 1), (42, 1), (43, 2), (44, 1)],
[(22, 1), (29, 2), (45, 2)],
[(46, 1), (47, 1)],
[(28, 1), (46, 1), (48, 1), (49, 1), (50, 1)],
[(8, 1), (43, 1), (47, 1), (51, 1)],
[(35, 1), (52, 1), (53, 1)],
[(52, 1), (53, 1), (54, 1)],
[(5, 1), (10, 1), (13, 1), (55, 1)],
[(52, 1), (53, 1), (56, 1)],
[(2, 1), (26, 1), (53, 2), (56, 1), (57, 1)],
[(23, 1), (27, 1), (58, 1), (59, 1), (60, 1)],
[(23, 1), (27, 1), (47, 1), (61, 1)],
[(10, 1), (25, 1), (62, 1)],
[(25, 2), (26, 1), (37, 1), (62, 1)],
[(17, 1), (43, 1), (63, 1), (64, 1), (65, 1)],
[(5, 1), (17, 1), (43, 1), (63, 1)],
[(6, 1), (57, 1), (66, 1)],
[(53, 1), (57, 1), (60, 1), (66, 1)],
[(17, 1), (20, 1), (54, 1)],
[(20, 1), (66, 1), (67, 1)],
[(20, 1), (26, 1)],
[(12, 1), (68, 1), (69, 1)],
[(12, 1), (16, 1), (64, 1), (70, 1)],
[(8, 1), (38, 1), (47, 1)],
[(13, 1), (17, 1), (43, 1), (55, 1), (71, 1)],
[(17, 1), (41, 1), (43, 1), (71, 1), (72, 1)],
[(29, 1), (47, 1), (63, 1)],
[(25, 1), (26, 1), (29, 1), (31, 1)],
[(21, 1), (63, 1), (73, 1)],
[(27, 2), (47, 1), (58, 2)],
[(5, 1), (10, 1), (19, 1), (55, 1), (58, 1)],
[(19, 1), (58, 1)],
[(27, 1), (58, 1), (74, 1)],
[(23, 1), (27, 1), (47, 1), (58, 1), (65, 1)],
[(23, 1), (47, 1), (58, 1), (67, 1), (74, 1)],
[(72, 2), (75, 2), (76, 2)],
[(54, 1), (76, 2)],
[(0, 1),
(17, 1),
(21, 1),
(24, 1),
(27, 1),
(43, 1),
(58, 1),
(65, 1),
(77, 1)],
[(0, 1), (1, 1), (19, 1), (23, 2), (24, 1), (26, 1), (58, 1), (61, 1)],
[(0, 1), (24, 1), (27, 1), (58, 1), (77, 1)],
[(78, 1), (79, 1)],
[(11, 1)],
[(50, 1), (67, 1), (78, 2), (79, 1), (80, 1)],
[(28, 1), (78, 1), (79, 1)],
[(6, 1),
(8, 1),
(28, 1),
(32, 1),
(34, 1),
(48, 1),
(51, 1),
(53, 1),
(81, 1)],
[(8, 1), (28, 1), (47, 1), (48, 1)],
[(28, 1), (48, 1), (80, 1), (82, 1)],
[(26, 1), (33, 1)],
[(33, 1), (52, 1), (53, 1), (80, 1), (82, 1)],
[(26, 1), (29, 1), (33, 1), (52, 5), (53, 5), (83, 1), (84, 1)],
[(34, 1), (47, 1), (83, 1)],
[(12, 1), (34, 1), (45, 1), (65, 1), (85, 1), (86, 1)],
[(8, 1), (12, 1), (47, 1), (51, 1)],
[(12, 1),
(17, 2),
(43, 2),
(50, 1),
(51, 1),
(69, 1),
(71, 1),
(80, 1),
(87, 1),
(88, 1)],
[(9, 1), (12, 1), (41, 1), (51, 1), (69, 1), (88, 1)],
[(14, 1), (44, 1)],
[(13, 1), (40, 1), (47, 1), (65, 1), (71, 1), (89, 1)],
[(59, 1), (80, 1)],
[(13, 1), (47, 1), (70, 1), (87, 1), (89, 1)],
[(34, 2), (47, 2), (49, 2), (71, 2), (87, 2), (90, 2)],
[(1, 1), (27, 1), (47, 1), (91, 1)],
[(39, 1)],
[(29, 1), (39, 1), (42, 1), (43, 1), (45, 1)],
[(29, 1), (50, 1), (52, 1), (53, 1), (92, 1)],
[(39, 1), (73, 1), (75, 1), (84, 1), (92, 1), (93, 1)],
[(6, 1), (7, 1), (15, 1), (22, 1)],
[(17, 1), (34, 1), (43, 1), (94, 1), (95, 1)],
[(17, 1), (43, 1), (68, 1), (90, 1), (95, 2), (96, 1)],
[(13, 1), (23, 1), (94, 1), (95, 1)],
[(40, 1), (54, 1)],
[(13, 1), (36, 1), (45, 1), (49, 1), (85, 1), (86, 2)],
[(17, 1),
(27, 1),
(30, 1),
(43, 1),
(58, 1),
(65, 2),
(91, 1),
(97, 1),
(98, 1)],
[(2, 1),
(6, 1),
(17, 1),
(42, 1),
(43, 2),
(62, 2),
(81, 1),
(97, 3),
(98, 1)],
[(32, 1), (34, 1), (93, 1), (96, 1)]]
Each entry in the corpus list represents a document. Within each document entry, there is a list of tuples . Each tuple contains
two values: the index of the term in the dictionary and its frequency within that specific document.
# LDA model
num_topics = 10
passes = 20
lda_model = LdaModel(corpus=corpus, id2word=dictionary, num_topics=num_topics, passes=passes)
Topic 0: neural, network, rnn, work, architecture, convolutional, give, computational, rather, lstm, layers, cn
n, images, image, classification, inverse, convolutions, task, using, describe
Topic 1: batch, wordvec, different, size, better, prefer, algorithm, random, cnns, structure, would, leaky, wor
d, embeddings, relu, function, use, training, networks, dropout
Topic 2: activation, neural, relu, function, cnn, classification, sigmoid, tanh, describe, network, propagation
, leaky, image, features, model, task, used, text, words, functions
Topic 3: embeddings, word, use, would, large, convolutional, small, advantages, rather, using, instead, case, n
lp, translation, makes, cnns, text, online, learning, different
Topic 4: activation, function, layer, model, problem, used, exploding, disadvantages, advantages, learning, han
dle, functions, gradient, nlp, nonlinearity, one, tree, makes, better, decision
Topic 5: use, function, sigmoid, activation, filter, relu, cnn, choose, text, softmax, tanh, training, size, wo
uld, layer, inverse, preferred, bad, nonlinearity, gd
Topic 6: descent, gradient, local, always, bad, minibatch, data, sgd, batch, training, gd, set, algorithm, give
, happens, vanishing, image, features, difference, nlp
Topic 7: neural, words, use, decision, relu, weights, network, text, deep, bag, ngrams, activation, model, vs,
networks, happens, linear, trees, tree, instead
Topic 8: explain, network, layers, neural, dropout, different, three, used, would, cnn, initialize, functions,
weights, online, help, sgd, one, set, prefer, lstm
Topic 9: difference, learning, gradient, machine, batch, deep, need, vs, vanishing, convolutions, nlp, layers,
layer, exploding, convolutional, lstm, sgd, use, explain, online
Document 0 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "com
putational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.10
Document 1 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "t
ext" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity" "
gd" with a probability of 0.77
Document 2 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "com
putational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.10
Document 3 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "com
putational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.10
Document 4 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "com
putational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.10
Document 5 is about Topic 2 - "activation" "neural" "relu" "function" "cnn" "classification" "sigmoid" "
tanh" "describe" "network" "propagation" "leaky" "image" "features" "model" "task" "used" "text" "wo
rds" "functions" with a probability of 0.55
Document 6 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "com
putational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.10
Document 7 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "com
putational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.55
Document 8 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "t
ext" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity" "
gd" with a probability of 0.55
Document 9 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "com
putational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.10
Document 10 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.70
Document 11 is about Topic 3 - "embeddings" "word" "use" "would" "large" "convolutional" "small" "advant
ages" "rather" "using" "instead" "case" "nlp" "translation" "makes" "cnns" "text" "online" "learning
" "different" with a probability of 0.70
Document 12 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "ba
tch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.70
Document 13 is about Topic 1 - "batch" "wordvec" "different" "size" "better" "prefer" "algorithm" "rando
m" "cnns" "structure" "would" "leaky" "word" "embeddings" "relu" "function" "use" "training" "networ
ks" "dropout" with a probability of 0.70
Document 14 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.77
Document 15 is about Topic 3 - "embeddings" "word" "use" "would" "large" "convolutional" "small" "advant
ages" "rather" "using" "instead" "case" "nlp" "translation" "makes" "cnns" "text" "online" "learning
" "different" with a probability of 0.77
Document 16 is about Topic 1 - "batch" "wordvec" "different" "size" "better" "prefer" "algorithm" "rando
m" "cnns" "structure" "would" "leaky" "word" "embeddings" "relu" "function" "use" "training" "networ
ks" "dropout" with a probability of 0.70
Document 17 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.70
Document 18 is about Topic 2 - "activation" "neural" "relu" "function" "cnn" "classification" "sigmoid"
"tanh" "describe" "network" "propagation" "leaky" "image" "features" "model" "task" "used" "text" "w
ords" "functions" with a probability of 0.55
Document 19 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.10
Document 20 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "ba
tch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.70
Document 21 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.82
Document 22 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.82
Document 23 is about Topic 4 - "activation" "function" "layer" "model" "problem" "used" "exploding" "dis
advantages" "advantages" "learning" "handle" "functions" "gradient" "nlp" "nonlinearity" "one" "tree"
"makes" "better" "decision" with a probability of 0.70
Document 24 is about Topic 4 - "activation" "function" "layer" "model" "problem" "used" "exploding" "dis
advantages" "advantages" "learning" "handle" "functions" "gradient" "nlp" "nonlinearity" "one" "tree"
"makes" "better" "decision" with a probability of 0.70
Document 25 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.37
Document 26 is about Topic 7 - "neural" "words" "use" "decision" "relu" "weights" "network" "text" "dee
p" "bag" "ngrams" "activation" "model" "vs" "networks" "happens" "linear" "trees" "tree" "instead" w
ith a probability of 0.55
Document 27 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.77
Document 28 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.70
Document 29 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.87
Document 30 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.10
Document 31 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "ba
tch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.87
Document 32 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.10
Document 33 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.55
Document 34 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.70
Document 35 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.82
Document 36 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.70
Document 37 is about Topic 2 - "activation" "neural" "relu" "function" "cnn" "classification" "sigmoid"
"tanh" "describe" "network" "propagation" "leaky" "image" "features" "model" "task" "used" "text" "w
ords" "functions" with a probability of 0.87
Document 38 is about Topic 1 - "batch" "wordvec" "different" "size" "better" "prefer" "algorithm" "rando
m" "cnns" "structure" "would" "leaky" "word" "embeddings" "relu" "function" "use" "training" "networ
ks" "dropout" with a probability of 0.85
Document 39 is about Topic 7 - "neural" "words" "use" "decision" "relu" "weights" "network" "text" "dee
p" "bag" "ngrams" "activation" "model" "vs" "networks" "happens" "linear" "trees" "tree" "instead" w
ith a probability of 0.70
Document 40 is about Topic 7 - "neural" "words" "use" "decision" "relu" "weights" "network" "text" "dee
p" "bag" "ngrams" "activation" "model" "vs" "networks" "happens" "linear" "trees" "tree" "instead" w
ith a probability of 0.85
Document 41 is about Topic 7 - "neural" "words" "use" "decision" "relu" "weights" "network" "text" "dee
p" "bag" "ngrams" "activation" "model" "vs" "networks" "happens" "linear" "trees" "tree" "instead" w
ith a probability of 0.82
Document 42 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "ba
tch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.77
Document 43 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "ba
tch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.53
Document 44 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.82
Document 45 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "ba
tch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.77
Document 46 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.87
Document 47 is about Topic 4 - "activation" "function" "layer" "model" "problem" "used" "exploding" "dis
advantages" "advantages" "learning" "handle" "functions" "gradient" "nlp" "nonlinearity" "one" "tree"
"makes" "better" "decision" with a probability of 0.50
Document 48 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.52
Document 49 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.52
Document 50 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.85
Document 51 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.85
Document 52 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.82
Document 53 is about Topic 4 - "activation" "function" "layer" "model" "problem" "used" "exploding" "dis
advantages" "advantages" "learning" "handle" "functions" "gradient" "nlp" "nonlinearity" "one" "tree"
"makes" "better" "decision" with a probability of 0.77
Document 54 is about Topic 4 - "activation" "function" "layer" "model" "problem" "used" "exploding" "dis
advantages" "advantages" "learning" "handle" "functions" "gradient" "nlp" "nonlinearity" "one" "tree"
"makes" "better" "decision" with a probability of 0.82
Document 55 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.77
Document 56 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.77
Document 57 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.70
Document 58 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "ba
tch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.77
Document 59 is about Topic 2 - "activation" "neural" "relu" "function" "cnn" "classification" "sigmoid"
"tanh" "describe" "network" "propagation" "leaky" "image" "features" "model" "task" "used" "text" "w
ords" "functions" with a probability of 0.82
Document 60 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.77
Document 61 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.54
Document 62 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.85
Document 63 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.54
Document 64 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.62
Document 65 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.77
Document 66 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.85
Document 67 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "used
" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lstm
" with a probability of 0.66
Document 68 is about Topic 4 - "activation" "function" "layer" "model" "problem" "used" "exploding" "dis
advantages" "advantages" "learning" "handle" "functions" "gradient" "nlp" "nonlinearity" "one" "tree"
"makes" "better" "decision" with a probability of 0.70
Document 69 is about Topic 2 - "activation" "neural" "relu" "function" "cnn" "classification" "sigmoid"
"tanh" "describe" "network" "propagation" "leaky" "image" "features" "model" "task" "used" "text" "w
ords" "functions" with a probability of 0.77
Document 70 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.85
Document 71 is about Topic 7 - "neural" "words" "use" "decision" "relu" "weights" "network" "text" "dee
p" "bag" "ngrams" "activation" "model" "vs" "networks" "happens" "linear" "trees" "tree" "instead" w
ith a probability of 0.85
Document 72 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.87
Document 73 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.77
Document 74 is about Topic 2 - "activation" "neural" "relu" "function" "cnn" "classification" "sigmoid"
"tanh" "describe" "network" "propagation" "leaky" "image" "features" "model" "task" "used" "text" "w
ords" "functions" with a probability of 0.91
Document 75 is about Topic 2 - "activation" "neural" "relu" "function" "cnn" "classification" "sigmoid"
"tanh" "describe" "network" "propagation" "leaky" "image" "features" "model" "task" "used" "text" "w
ords" "functions" with a probability of 0.91
Document 76 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.85
Document 77 is about Topic 3 - "embeddings" "word" "use" "would" "large" "convolutional" "small" "advant
ages" "rather" "using" "instead" "case" "nlp" "translation" "makes" "cnns" "text" "online" "learning
" "different" with a probability of 0.70
Document 78 is about Topic 1 - "batch" "wordvec" "different" "size" "better" "prefer" "algorithm" "rando
m" "cnns" "structure" "would" "leaky" "word" "embeddings" "relu" "function" "use" "training" "networ
ks" "dropout" with a probability of 0.55
Document 79 is about Topic 3 - "embeddings" "word" "use" "would" "large" "convolutional" "small" "advant
ages" "rather" "using" "instead" "case" "nlp" "translation" "makes" "cnns" "text" "online" "learning
" "different" with a probability of 0.87
Document 80 is about Topic 3 - "embeddings" "word" "use" "would" "large" "convolutional" "small" "advant
ages" "rather" "using" "instead" "case" "nlp" "translation" "makes" "cnns" "text" "online" "learning
" "different" with a probability of 0.53
Document 81 is about Topic 2 - "activation" "neural" "relu" "function" "cnn" "classification" "sigmoid"
"tanh" "describe" "network" "propagation" "leaky" "image" "features" "model" "task" "used" "text" "w
ords" "functions" with a probability of 0.91
Document 82 is about Topic 7 - "neural" "words" "use" "decision" "relu" "weights" "network" "text" "dee
p" "bag" "ngrams" "activation" "model" "vs" "networks" "happens" "linear" "trees" "tree" "instead" w
ith a probability of 0.82
Document 83 is about Topic 4 - "activation" "function" "layer" "model" "problem" "used" "exploding" "dis
advantages" "advantages" "learning" "handle" "functions" "gradient" "nlp" "nonlinearity" "one" "tree"
"makes" "better" "decision" with a probability of 0.82
Document 84 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.70
Document 85 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "ba
tch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.51
Document 86 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "ba
tch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.94
Document 87 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.77
Document 88 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.87
Document 89 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.82
Document 90 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.93
Document 91 is about Topic 2 - "activation" "neural" "relu" "function" "cnn" "classification" "sigmoid"
"tanh" "describe" "network" "propagation" "leaky" "image" "features" "model" "task" "used" "text" "w
ords" "functions" with a probability of 0.87
Document 92 is about Topic 1 - "batch" "wordvec" "different" "size" "better" "prefer" "algorithm" "rando
m" "cnns" "structure" "would" "leaky" "word" "embeddings" "relu" "function" "use" "training" "networ
ks" "dropout" with a probability of 0.70
Document 93 is about Topic 9 - "difference" "learning" "gradient" "machine" "batch" "deep" "need" "vs"
"vanishing" "convolutions" "nlp" "layers" "layer" "exploding" "convolutional" "lstm" "sgd" "use" "exp
lain" "online" with a probability of 0.87
Document 94 is about Topic 3 - "embeddings" "word" "use" "would" "large" "convolutional" "small" "advant
ages" "rather" "using" "instead" "case" "nlp" "translation" "makes" "cnns" "text" "online" "learning
" "different" with a probability of 0.70
Document 95 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.85
Document 96 is about Topic 3 - "embeddings" "word" "use" "would" "large" "convolutional" "small" "advant
ages" "rather" "using" "instead" "case" "nlp" "translation" "makes" "cnns" "text" "online" "learning
" "different" with a probability of 0.93
Document 97 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.82
Document 98 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose" "
text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.55
Document 99 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "co
mputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions"
"task" "using" "describe" with a probability of 0.52
Document 100 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "b
atch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.68
Document 101 is about Topic 6 - "descent" "gradient" "local" "always" "bad" "minibatch" "data" "sgd" "b
atch" "training" "gd" "set" "algorithm" "give" "happens" "vanishing" "image" "features" "difference"
"nlp" with a probability of 0.87
Document 102 is about Topic 4 - "activation" "function" "layer" "model" "problem" "used" "exploding" "di
sadvantages" "advantages" "learning" "handle" "functions" "gradient" "nlp" "nonlinearity" "one" "tree"
"makes" "better" "decision" with a probability of 0.82
Document 103 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "use
d" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lst
m" with a probability of 0.85
Document 104 is about Topic 7 - "neural" "words" "use" "decision" "relu" "weights" "network" "text" "de
ep" "bag" "ngrams" "activation" "model" "vs" "networks" "happens" "linear" "trees" "tree" "instead"
with a probability of 0.89
Document 105 is about Topic 8 - "explain" "network" "layers" "neural" "dropout" "different" "three" "use
d" "would" "cnn" "initialize" "functions" "weights" "online" "help" "sgd" "one" "set" "prefer" "lst
m" with a probability of 0.51
Document 106 is about Topic 0 - "neural" "network" "rnn" "work" "architecture" "convolutional" "give" "c
omputational" "rather" "lstm" "layers" "cnn" "images" "image" "classification" "inverse" "convolutions
" "task" "using" "describe" with a probability of 0.70
Document 107 is about Topic 5 - "use" "function" "sigmoid" "activation" "filter" "relu" "cnn" "choose"
"text" "softmax" "tanh" "training" "size" "would" "layer" "inverse" "preferred" "bad" "nonlinearity"
"gd" with a probability of 0.89
Document 108 is about Topic 4 - "activation" "function" "layer" "model" "problem" "used" "exploding" "di
sadvantages" "advantages" "learning" "handle" "functions" "gradient" "nlp" "nonlinearity" "one" "tree"
"makes" "better" "decision" with a probability of 0.92
Document 109 is about Topic 7 - "neural" "words" "use" "decision" "relu" "weights" "network" "text" "de
ep" "bag" "ngrams" "activation" "model" "vs" "networks" "happens" "linear" "trees" "tree" "instead"
with a probability of 0.94
Document 110 is about Topic 1 - "batch" "wordvec" "different" "size" "better" "prefer" "algorithm" "rand
om" "cnns" "structure" "would" "leaky" "word" "embeddings" "relu" "function" "use" "training" "netwo
rks" "dropout" with a probability of 0.82
plt.figure(figsize=(8, 6))
num_topics = lda_model.num_topics
plt.hist(document_topics, bins=np.arange(-0.5, num_topics + 0.5, 1), color='skyblue', edgecolor='black')
plt.title('Topic Distribution of Documents')
plt.xlabel('Topics')
plt.ylabel('Frequency')
plt.xticks(range(num_topics))
plt.show()
topic_labels = {}
for topic_num, topic_words in top_words_per_topic:
words = [word.split('*')[1].replace('"', '').strip() for word in topic_words.split('+')]
topic_labels[topic_num] = words
plt.figure(figsize=(8, 4))
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis('off')
plt.title(f"Topic {topic_num} Word Cloud")
plt.show()
# top words for each topic
top_words_per_topic = lda_model.show_topics(num_words=10, formatted=False)
plt.figure(figsize=(12, 8))
plt.tight_layout()
plt.show()
word_freq = Counter(all_words)
common_words = dict(word_freq.most_common(50))
plt.figure(figsize=(16, 8))
colors = plt.cm.tab20c.colors
plt.show()