python中的定性研究支持工具!
qrmine的Python项目详细描述
qrmine
/k_rm_n/
qrmine是一套在python中使用自然语言处理(nlp)和机器学习(ml)的定性研究(qr)数据挖掘工具。qrmine正在工作中。Read More..
它的功能
nlp
- [X]列出了开放式编码的常用类别。
- [X]创建一个包含类别、属性和维度的编码字典。
- [X]主题建模。
- [X]根据主题安排文档。
- [X]比较两份文件/访谈。
- [X]按情绪、类别或标题选择文件/访谈,以便进一步分析。
- [X]情绪分析
- []网络分析
- []联合引文查找器
毫升
- [X]使用数据训练的神经网络模型的精度
- [X]来自支持向量机分类器的混淆矩阵
- [x]k给定记录的最近邻
- [X]K-均值聚类
- [X]主成分分析(PCA)
- []关联规则
如何安装
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.1.0/en_core_web_sm-2.1.0.tar.gz#egg=en_core_web_sm pip install qrmine
如何使用
输入文件是文本文件和包含数字数据的单个csv文件。可以指定输出TXT文件。
可以使用相应的命令行选项从整个语料库(所有文档)创建编码字典、主题和主题分配。
类别(概念)、摘要和情感可以查看整个语料库或使用--titles开关指定的特定标题(文档)。句子级的情感输出可以使用--sentence标志。
您可以根据情感、标题或类别筛选文档,并使用--filters或-f进行进一步分析
许多ml函数,比如神经网络,都有第二个参数(-n)。在NNET-N中,表示年代数、Kmeans中的簇数、PCA中的因子数和KNN中的邻居数。knn还接受--rec或-r参数来指定记录。
CSV中的变量可以使用--titles(默认为all)选择。第一个变量将被忽略(索引),最后一个变量将是dv(从属变量)。
命令行选项
pythom -m qrmine --help
Command | Alternate | Description |
---|---|---|
--inp | -i | Input file in the text format with <break> Topic </break> |
--out | -o | Output file name |
--csv | csv file name | |
--num | -n | N (clusters/epochs etc depending on context) |
--rec | -r | Record (based on context) |
--titles | -t | Document(s) title(s) to analyze/compare |
--codedict | Generate coding dictionary | |
--topics | Generate topic model | |
--assign | Assign documents to topics | |
--cat | List categories of entire corpus or individual docs | |
--summary | Generate summary for entire corpus or individual docs | |
--sentiment | Generate sentiment score for entire corpus or individual docs | |
--nlp | Generate all NLP reports | |
--sentence | Generate sentence level scores when applicable | |
--nnet | Display accuracy of a neural network model -n epochs(3) | |
--svm | Display confusion matrix from an svm classifier | |
--knn | Display nearest neighbours -n neighbours (3) | |
--kmeans | Display KMeans clusters -n clusters (3) | |
--cart | Display Association Rules | |
--pca | Display PCA -n factors (3) |
在代码中使用它
fromqrmineimportContentfromqrmineimportNetworkfromqrmineimportQrminefromqrmineimportReadDatafromqrmineimportSentimentfromqrmineimportMLQRMine
- 提供更多说明和Jupyter笔记本here.
输入文件格式
nlp
单个文本文件中的单个文档或面试记录,由主题分隔。下面的示例
Transcript 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>
....
支持多个文件,每个文件在主题的底部只有一个break标记。 (以后可能会重命名标记)
毫升
具有以下通用结构的单个csv文件。
- 带标识符的列1。如果与上述文本文档相关,请包含标题。
- 最后一列有因变量(dv)。(NLP算法,如主题组件可以提供DV)
- 所有自变量(数值)之间。
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
......
作者
- Bell Eapen(麦克马斯特u)Contact
- 这个软件是使用Compute Canada资源开发和测试的。
- 另请参见::fire: The FHIRForm framework for managing healthcare eForms
- 另请参见::eyes: Drishti | An mHealth sense-plan-act framework!
引文
如果有助于你的研究,请在你的出版物中引用qrmine。在这里 是bibtex条目的示例:
@misc{eapenbr2019qrmine,
title={QRMine -Qualitative Research Tools in Python.},
author={Eapen, Bell Raj and contributors},
year={2019},
publisher={GitHub},
journal = {GitHub repository},
howpublished={\url{https://github.com/dermatologist/qrmine}}
}
随着这个工具的理论基础的出版正在进行中。qrmine的灵感来自this work和相关的paper。