如何根据相同单词对句子进行聚类?

这是我的样本数据:

maybe add a higher-level descriptionmin of spare daemonsdata in the appropriate orderthe compiled max daemonsan iovec to store the trailer sent after the filedata in the wrong orderan iovec to store the headers sent before the filereturn err maybe add a higher-level descif a user manually creates a data file

我想采用聚类方法,自动将这些数据根据句子中出现的相同单词分类,我的目标是这样的:

  1. add

    maybe add a higher-level description

    return err maybe add a higher-level desc

  2. damons

    min of spare daemons

    the compiled max daemons

  3. iovec

    an iovec to store the headers sent before the file

    an iovec to store the trailer sent after the file

  4. data

    data in the wrong order

    data in the appropriate order

    if a user manually creates a data file

能有人帮帮我吗?非常感谢!


回答:

听起来你想找出最常见的单词

这并不难做到(而且不是“聚类”,只是计数并按常见单词分组),你尝试过什么,你卡在哪里了?

Related Posts

L1-L2正则化的不同系数

我想对网络的权重同时应用L1和L2正则化。然而,我找不…

使用scikit-learn的无监督方法将列表分类成不同组别,有没有办法?

我有一系列实例,每个实例都有一份列表,代表它所遵循的不…

f1_score metric in lightgbm

我想使用自定义指标f1_score来训练一个lgb模型…

通过相关系数矩阵进行特征选择

我在测试不同的算法时,如逻辑回归、高斯朴素贝叶斯、随机…

可以将机器学习库用于流式输入和输出吗?

已关闭。此问题需要更加聚焦。目前不接受回答。 想要改进…

在TensorFlow中,queue.dequeue_up_to()方法的用途是什么?

我对这个方法感到非常困惑,特别是当我发现这个令人费解的…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注