Skip to main content

用于应用 NLP 交互式聚类方法的 Python 包。

项目描述

交互式聚类

词 文件 pypi版本 DOI

用于应用 NLP 交互式聚类方法的 Python 包。

简要说明

交互式聚类是一种旨在帮助设计训练数据集的方法。

这个迭代过程从一个未标记的数据集开始,它使用两个子步骤的序列:

  1. 用户定义对计算机采样数据的约束;

  2. 计算机使用约束聚类算法执行数据分区。

因此,在流程的每一步:

  • 用户使用约束更正先前步骤的聚类,并且

  • 计算机为下一步提供了正确且更相关的数据分区。

该过程使用多个对象:

  • 约束管理器:其作用是管理用户标注的约束并反馈推导出的信息(如约束之间的传递性或不一致的情况);

  • 约束采样器:它的作用是在用户标注约束时选择最相关的数据;

  • 一种受约束的聚类算法:它的作用是在尊重用户提供的约束的同时对数据进行分区。

注意

  • 这个 python 库不包含集成到图形界面中。

  • 有关更多详细信息,请阅读参考资料部分中的文档和文章。

文档

要求

交互式集群需要 Python 3.7 或更高版本。

要安装 Python 3.7,我建议使用pyenv.
# install pyenv
git clone https://github.com/pyenv/pyenv ~/.pyenv

# setup pyenv (you should also put these three lines in .bashrc or similar)
export PATH="${HOME}/.pyenv/bin:${PATH}"
export PYENV_ROOT="${HOME}/.pyenv"
eval "$(pyenv init -)"

# install Python 3.7
pyenv install 3.7

# make it available globally
pyenv global system 3.7

安装

pip

# install package
python3 -m pip install cognitivefactory-interactive-clustering

# install spacy language model dependencies (the one you want, with version "3.1.x")
python3 -m spacy download fr_core_news_md-3.1.0 --direct

pipx

# install pipx
python3 -m pip install --user pipx

# install package
pipx install --python python3 cognitivefactory-interactive-clustering

# install spacy language model dependencies (the one you want, with version "3.1.x")
python3 -m spacy download fr_core_news_md-3.1.0 --direct

注意:其他 spaCy 语言模型可以在这里下载:spaCy-Models & Languages。使用 spacy 版本"3.1.x"

发展

要处理此项目或为其做出贡献,请阅读 Copier PDM 文档

快速设置和帮助

获取代码并准备环境:

git clone https://github.com/cognitivefactory/interactive-clustering/
cd interactive-clustering
make setup

显示帮助:

make help  # or just make

有关更多详细信息,请阅读贡献文档。

参考

  • 交互式聚类

    • 第一次介绍:Schild, E., Durantin, G., Lamirel, J.C., & Miconi, F. (2021). Conception itérative et semi-supervisée d'assistants conversationnels par regroupement interactif des questions. In EGC 2021 - 21èmes Journées Francophones Extraction et Gestion des Connaissances. Edition RNTI. ⟨hal-03133007⟩.
    • 理论研究:Schild, E., Durantin, G., Lamirel, J., & Miconi, F. (2022). Iterative and Semi-Supervised Design of Chatbots Using Interactive Clustering. International Journal of Data Warehousing and Mining (IJDWM), 18(2), 1-19. http://doi.org/10.4018/IJDWM.298007. ⟨hal-03648041⟩.
    • 方法论讨论:Schild, E., Durantin, G., & Lamirel, J.C. (2021). Concevoir un assistant conversationnel de manière itérative et semi-supervisée avec le clustering interactif. In Atelier - Fouille de Textes - Text Mine 2021 - En conjonction avec EGC 2021. ⟨hal-03133060⟩.
  • 约束和约束聚类

    • 聚类中的约束:Wagstaff, K. et C. Cardie (2000). Clustering with Instance-level Constraints. Proceedings of the Seventeenth International Conference on Machine Learning, 1103–1110.
    • 约束聚类调查:Lampert, T., T.-B.-H. Dao, B. Lafabregue, N. Serrette, G. Forestier, B. Cremilleux, C. Vrain, et P. Gancarski (2018). Constrained distance based clustering for time-series : a comparative and experimental study. Data Mining and Knowledge Discovery 32(6), 1663–1707.
    • KMeans 聚类:
      • KMeans 聚类:MacQueen, J. (1967). Some methods for classification and analysis of multivariate observations. Proceedings of the fifth Berkeley symposium on mathematical statistics and probability 1(14), 281–297.
      • 受约束的 'COP' KMeans 聚类:Wagstaff, K., C. Cardie, S. Rogers, et S. Schroedl (2001). Constrained K-means Clustering with Background Knowledge. International Conference on Machine Learning
    • 层次聚类:
      • 层次聚类:Murtagh, F. et P. Contreras (2012). Algorithms for hierarchical clustering : An overview. Wiley Interdisc. Rew.: Data Mining and Knowledge Discovery 2, 86–97.
      • 约束层次聚类:Davidson, I. et S. S. Ravi (2005). Agglomerative Hierarchical Clustering with Constraints : Theoretical and Empirical Results. Springer, Berlin, Heidelberg 3721, 12.
    • 光谱聚类:
      • 光谱聚类:Ng, A. Y., M. I. Jordan, et Y.Weiss (2002). On Spectral Clustering: Analysis and an algorithm. In T. G. Dietterich, S. Becker, et Z. Ghahramani (Eds.), Advances in Neural Information Processing Systems 14. MIT Press.
      • 受约束的“SPEC”光谱聚类:Kamvar, S. D., D. Klein, et C. D. Manning (2003). Spectral Learning. Proceedings of the international joint conference on artificial intelligence, 561–566.
  • 预处理和矢量化

    • 斯帕西Honnibal, M. et I. Montani (2017). spaCy 2 : Natural language understanding with Bloom embeddings, convolutional neural networks and incremental parsing.
      • spaCy语言模型:https://spacy.io/usage/models
    • NLTKBird, Steven, Edward Loper and Ewan Klein (2009), Natural Language Processing with Python. O’Reilly Media Inc.
      • NLTK 'SnowballStemmer'https://www.nltk.org/api/nltk.stem.html#module-nltk.stem.snowball
    • 科学学习Pedregosa, F., G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R.Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, et E. Duchesnay (2011). Scikit-learn : Machine Learning in Python. Journal of Machine Learning Research 12, 2825–2830.
      • Scikit-learn 'TfidfVectorizer'https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.TfidfVectorizer.html

如何引用

Schild, E. (2021). cognitivefactory/interactive-clustering. Zenodo. https://doi.org/10.5281/zenodo.4775251.

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

认知工厂交互式集群0.5.3.tar.gz (60.1 kB 图哈希)

已上传 source

内置分布

cognitivefactory_interactive_clustering-0.5.3-py3-none-any.whl (55.9 kB 查看哈希

已上传 py3