qrmine package

Subpackages

Submodules

qrmine.cluster module

Copyright (C) 2025 Bell Eapen

This file is part of qrmine.

qrmine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

qrmine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with qrmine. If not, see <https://www.gnu.org/licenses/>.

class qrmine.cluster.ClusterDocs(content: Content, documents=[], titles=[])[source]

Bases: object

build_lda_model()[source]
property corpus
doc_vectorizer(doc, model)[source]
property documents
format_topics_sentences(visualize=False)[source]
property lda_model
most_representative_docs()[source]
property num_topics
property passes
preprocess(doc)[source]
print_clusters()[source]
print_topics(num_words=5)[source]
process()[source]
property processed_docs
property titles
topics_per_document(start=0, end=1)[source]
vectorizer(docs, titles, num_clusters=4, visualize=False)[source]

qrmine.content module

Copyright (C) 2020 Bell Eapen

This file is part of qrmine.

qrmine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

qrmine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with qrmine. If not, see <http://www.gnu.org/licenses/>.

class qrmine.content.Content(content='', title='', lang='en_core_web_sm', max_length=1100000)[source]

Bases: object

attributes(word, index=3)[source]
common_nouns(index=10)[source]
common_verbs(index=10)[source]
common_words(index=10)[source]
property content
property dep
dimensions(word, index=3)[source]
property doc
generate_summary(weight=10)[source]

[summary]

Parameters:

weight (int, optional) – Parameter for summary generation weight. Defaults to 10.

Returns:

A list of summary lines

Return type:

list

property idx
property lang
property lemma
property pos
property pos_
property prob
process()[source]
sentences_with_common_nouns(index=10)[source]
property sentiment
spans_with_common_nouns(word)[source]
property tag
property title
property tokens
property word

qrmine.main module

qrmine.main.filter_data(inp, search, sentence, num)[source]
qrmine.main.generate_categories(data, tags, num)[source]
qrmine.main.generate_dict(data, num)[source]
qrmine.main.generate_summary(data, tags)[source]
qrmine.main.generate_topics(data, assign, num)[source]
qrmine.main.get_association(ml)[source]
qrmine.main.get_categories_association(data, num)[source]
qrmine.main.get_kmeans(ml, n=3)[source]
qrmine.main.get_knn(ml, n=3, r=3)[source]
qrmine.main.get_nnet(ml, n=3)[source]
qrmine.main.get_pca(ml, n=3, verbose=None)[source]
qrmine.main.get_sentiment(data, tags, sentence, verbose)[source]
qrmine.main.get_svm(ml)[source]
qrmine.main.main(input_file)[source]
qrmine.main.main_routine()[source]

qrmine.mlqrmine module

class qrmine.mlqrmine.MLQRMine[source]

Bases: object

property X
property csvfile
property dataset
encode_categorical()[source]
property epochs
get_apriori()[source]
get_association()[source]
get_centroids(c=1)[source]
get_kmeans(c=5)[source]
get_nnet_predictions()[source]
get_nnet_scores()[source]
get_pca(n=3)[source]
get_shape()[source]
property head
mark_missing()[source]
property model
oversample()[source]
prepare_data(oversample=False)[source]
read_csv()[source]
read_xy()[source]
restore_mark_missing()[source]
restore_oversample()[source]
property seed
svm_confusion_matrix()[source]

Generate confusion matrix for SVM

Returns:

[list] – [description]

property titles
property y
class qrmine.mlqrmine.NeuralNet(input_dim)[source]

Bases: Module

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

qrmine.network module

class qrmine.network.Network[source]

Bases: object

draw_graph(draw=False)[source]
sents_to_network(sents)[source]
terms_to_network(terms)[source]

qrmine.nlp_qrmine module

class qrmine.nlp_qrmine.Qrmine[source]

Bases: object

category_association(num=10)[source]

Generates the support for itemsets

Parameters:

num (int, optional) – number of categories to generate for each doc in corpus. . Defaults to 10.

category_basket(num=10)[source]

Generates a basket of categories for association

Parameters:

num (int, optional) – number of categories to generate for each doc in corpus. Defaults to 10.

Returns:

The list of lists (each list is categories in each document)

Return type:

list

common_verbs(common_verbs)[source]
property content
filter_content(titles)[source]
property get_git_revision_hash
property get_git_revision_short_hash
load_matrix()[source]
min_topic(min_topic)[source]
print_categories(doc, num=10)[source]
print_dict(content, num=10, top_n=5)[source]
print_documents(top_n=2)[source]
static print_table(table)[source]
print_topics(numtopics=0)[source]
process_content()[source]
unique(list1)[source]

qrmine.readfiles module

class qrmine.readfiles.ReadData[source]

Bases: object

append(title, document)[source]
property content
property documents
read_file(input, comma_separated_ignore_words=None)[source]
property titles

qrmine.sentiment module

class qrmine.sentiment.Sentiment[source]

Bases: object

hamming(str1, str2)[source]
sentiment()[source]
sentiment_analyzer_scores(sentence)[source]
similarity(obj1, obj2, fuzzy_match=False, match_threshold=0.8)[source]

qrmine.utils module

class qrmine.utils.QRUtils[source]

Bases: object

static read_covid_narratives(output_folder)[source]

qrmine.visualize module

Copyright (C) 2025 Bell Eapen

This file is part of qrmine.

qrmine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

qrmine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with qrmine. If not, see <https://www.gnu.org/licenses/>.

class qrmine.visualize.QRVisualize(data: DataFrame = None)[source]

Bases: object

cluster_chart(data, folder_path=None)[source]
hover(event)[source]
most_discussed_topics(lda_model, dominant_topics, topic_percentages, folder_path=None)[source]
plot_distribution_by_topic(df=None, folder_path=None)[source]
plot_frequency_distribution_of_words(df=None, folder_path=None)[source]
plot_importance(topics=None, processed_docs=None, folder_path=None)[source]
plot_wordcloud(topics=None, folder_path=None)[source]
sentence_chart(lda_model=None, corpus=None, start=0, end=13, folder_path=None)[source]
update_annot(ind)[source]

Module contents