Solr/Carrot2 集成

Solr/Carrot2 集成

我为每个文本文件创建了 XML,用于在 Solr 中索引文档,如下所示:

<add>  <doc>    <person>data </person>    <organization>data here </organization>    <content>Some spanish text here</content >  </doc><add>

索引时使用的 Schema

<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />    <field name="person" type="string"  indexed="true" stored="true" required="true" multiValued="true" /><field name="orgnization" type="string" indexed="true" stored="true" required="true" multiValued="true"   /><field name="content" type="text_es" indexed="true" stored="true" multiValued="true"/>  <field name="location" type="string"  indexed="true" stored="true" required="true" multiValued="true" />

现在我正在尝试集成 Carrot2 聚类,为此我参考了这个链接 http://carrot2.github.io/solr-integration-strategies/carrot2-3.8.0/index.html

我的问题是,聚类查询的结果只得到一个聚类,如下所示:

<arr name="clusters">  <lst><arr name="labels">  <str>Other Topics</str>    </arr>    <double name="score">0.0</double>    <bool name="other-topics">true</bool>    <arr name="docs">      <str>#.txt</str>      <str>abci-britanicos-pizzerias-201312120250.txt</str>      <str>abci-arqueologos-israelis-descubren-primer-201312111303.txt</str>      <str>abci-autoridad-fiscal-pensiones-201312111956.txt</str>      <str>abci-buenas-razones-para-cambiar-201312110933.txt</str>      <str>abci-audio-asamblea-aserpinto-201312112139.txt</str>      <    </arr>  </lst>  </arr>

我的语料库包含 60 个文本文档,应该得到更多的聚类


回答:

为了使 Solr 中的搜索结果聚类功能正常工作,您传递给聚类的标题和内容字段必须是存储的。Solr 中的 Schema 声明可以如下所示:

<field name="content" type="text" indexed="true" stored="true" />

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

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