RapidAPI logo

Text Clustering

フリーミアム
開発者 MeaningCloud
更新日 4ヶ月前
2.2/10
人気度
647ms
レイテンシ
100%
正常稼働率

「Text Clustering 」のドキュメント

テキストクラスタリングは、自動文書クラスタリング、すなわち、同じグループ(クラスタと呼ばれる)のテキストが他のクラスタのテキストよりも互いに類似するようにテキストセットをグループ化するためのMeaningCloudの解決策である。

全文を表示する
POST/clustering-1.1
POST/clustering-1.1

テキストクラスタリング1.1

ヘッダーパラメータ
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
AcceptSTRING
OPTIONAL
必須パラメータ
langSTRING
REQUIREDLanguage in which the text is ('en', 'es', 'it', 'fr', 'pt')
txtSTRING
REQUIREDThis parameter will contain one or more texts, one per line. All the texts sent in this parameter will be assigned automatically the ID used to identify them at the output. The IDs will be numerical, and will start from 1.
パラメータ(Option)
idSTRING
OPTIONALThis parameter will contain the IDs associated to the input texts. Each ID will have to be included in a different line, and the number of IDs included has to be the same as the number of texts included in txt.
modeSTRING
OPTIONALThis parameter will define the approach used to carry out the clustering process. To read more about the possibilities check the Clustering modes section: https://www.meaningcloud.com/developer/text-clustering/doc/1.1/request#clustering-modes
swSTRING
OPTIONALStopwords to be ignored by the algorithm, both in the clustering process, and as labels for the clusters. The valid format is a stopword per line (separated by linefeed "\n"). These stopwords are added to the ones used by default for the selected lang.
コードスニペット
unirest.post("https://meaningcloud-text-clustering-v1.p.rapidapi.com/clustering-1.1")
.header("X-RapidAPI-Host", "meaningcloud-text-clustering-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "ログインしてキーを取得")
.header("Accept", "application/json")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("id=text01%0Atext02%0Atext03%0Atext04%0Atext05")
.send("lang=en")
.send("txt=He earns $200,000/yr and still has a mortgage on his house :(%0AZara clothes will be the death of my credit card%0AMy bank insisted I destroyed my credit card before I could get a mortgage%0AI'm not paying the mortgage or credit card bills%0ATell them you've never had a loan, you have no mortgage")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
サンプルレスポンス
概要
リクエストURL: https://meaningcloud-text-clustering-v1.p.rapidapi.com/clustering-1.1
リクエストメソッド: POST
レスポンスヘッダ
レスポンスボディ

SDKをインストール(NodeJS)

インストール

Node.jsでUnirestを使用するには、NPMモジュールをインストールしてください。

$ npm install unirest

インストール完了後は、簡単にリクエストを行うことができるようになります。

var unirest = require('unirest');

リクエスト

unirest.post("https://meaningcloud-text-clustering-v1.p.rapidapi.com/clustering-1.1")
.header("X-RapidAPI-Host", "meaningcloud-text-clustering-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "ログインしてキーを取得")
.header("Accept", "application/json")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("id=text01%0Atext02%0Atext03%0Atext04%0Atext05")
.send("lang=en")
.send("txt=He earns $200,000/yr and still has a mortgage on his house :(%0AZara clothes will be the death of my credit card%0AMy bank insisted I destroyed my credit card before I could get a mortgage%0AI'm not paying the mortgage or credit card bills%0ATell them you've never had a loan, you have no mortgage")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2認証
クライアントID
クライアントシークレット
OAuth2認証