Package: qrmine
:flashlight: QRMine/ˈkärmīn/QRMine is a suite of qualitative research (QR) data mining tools in Python using Natural Language Processing (NLP) and Machine Learning (ML). QRMine is work in progress.Read More..What it doesNLPLists common categories for open coding.Create a coding dictionary with categories, properties and dimensions.Topic modelling.Arrange docs according to topics.Compare two documents/interviews.Select documents/interviews by sentiment, category or title for further analysis.Sentiment analysisMLAccuracy of a neural network model trained using the dataConfusion matrix from an support vector machine classifierK nearest neighbours of a given recordK-Means clusteringPrincipal Component Analysis (PCA)Association rulesHow to installpip install qrmine
python -m spacy download en_core_web_smMac usersMac users, please installlibompfor XGBoostbrew install libompHow to Useinput files are transcripts as txt files and a single csv file with numeric data. The output txt file can be specified.The coding dictionary, topics and topic assignments can be created from the  entire corpus (all documents) using the respective command line options.Categories (concepts), summary and sentiment can be viewed for entire corpus or specific titles (documents) specified using the --titles switch. Sentence level sentiment output is possible with the --sentence flag.You can filter documents based on sentiment, titles or categories and do further analysis, using --filters or -fMany of the ML functions like neural network takes a second argument (-n) . In nnet -n signifies the number of epochs, number of clusters in kmeans, number of factors in pca, and number of neighbours in KNN. KNN also takes the --rec or -r argument to specify the record.Variables from csv can be selected using --titles (defaults to all). The first variable will be ignored (index) and the last will be the DV (dependant variable).Command-line optionsqrmine --helpCommandAlternateDescription--inp-iInput file in the text format with  Topic--out-oOutput file name--csvcsv file name--num-nN (clusters/epochs etc depending on context)--rec-rRecord (based on context)--titles-tDocument(s) title(s) to analyze/compare--codedictGenerate coding dictionary--topicsGenerate topic model--assignAssign documents to topics--catList categories of entire corpus or individual docs--summaryGenerate summary for entire corpus or individual docs--sentimentGenerate sentiment score for entire corpus or individual docs--nlpGenerate all NLP reports--sentenceGenerate sentence level scores when applicable--nnetDisplay accuracy of a neural network model -n epochs(3)--svmDisplay confusion matrix from an svm classifier--knnDisplay nearest neighbours -n neighbours (3)--kmeansDisplay KMeans clusters -n clusters (3)--cartDisplay Association Rules--pcaDisplay PCA -n factors (3)Use it in your codefromqrmineimportContentfromqrmineimportNetworkfromqrmineimportQrminefromqrmineimportReadDatafromqrmineimportSentimentfromqrmineimportMLQRMineMore instructions and a jupyter notebook availablehere.Input file formatNLPIndividual documents or interview transcripts in a single text file separated by Topic. Example belowTranscript of the first interview with John.
Any number of lines
<break>First_Interview_John</break>

Text of the second interview with Jane.
More text.
<break>Second_Interview_Jane</break>

....Multiple files are suported, each having only one break tag at the bottom with the topic.
(The tag may be renamed in the future)MLA single csv file with the following generic structure.Column 1 with identifier. If it is related to a text document as above, include the title.Last column has the dependent variable (DV). (NLP algorithms like the topic asignments may provide the DV)All independent variables (numerical) in between.index, obesity, bmi, exercise, income, bp, fbs, has_diabetes
1, 0, 29, 1, 12, 120, 89, 1
2, 1, 32, 0, 9, 140, 92, 0
......AuthorBell Eapen(McMaster U) |Contact|This software is developed and tested usingCompute Canadaresources.See also::fire: The FHIRForm framework for managing healthcare eFormsSee also::eyes: Drishti | An mHealth sense-plan-act framework!CitationPlease cite QRMine in your publications if it helped your research. Here
is an example BibTeX entry(Read paper on arXiv):@article{eapenbr2019qrmine,
  title={QRMine: A python package for triangulation in Grounded Theory},
  author={Eapen, Bell Raj and Archer, Norm and Sartpi, Kamran},
  journal={arXiv preprint arXiv:2003.13519 },
  year={2020}
}QRMine is inspired bythis workand the associatedpaper.Give us a star ⭐️If you find this project useful, give us a star. It helps others discover the project.Demo