2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Watson Discovery] 助詞で引っかかった文書が検索結果として返ってくる

Last updated at Posted at 2023-07-13

概要

Watson Discovery の Document Retrieval プロジェクトで検索を行うときに、「の」や「てにをは」などの助詞で引っかかった文書が検索結果として返ってくる場合があります。
Watson Discovery v2 の日本語処理では、助詞で引っかかった文書を検索結果から除外するストップワードがデフォルトで適用されていないため、ユーザーが明示的にストップワードとして設定する必要があります。

今回は、以下のサンプル文書を登録しています。
image1.png

この状態で「振込の限度額」というキーワードで検索をしてみます。すると、「の」というキーワードで検索に引っかかってしまっている文書(「振込」と「限度額」とは無関係な文書)が検索結果として返ってきていることがわかります。

image2.png

設定手順

1. ストップワード・リストを用意する

下記リンク先から「custom_stopwords_ja.json」をダウンロードします。
「custom_stopwords_ja.json」は、「の」「てにをは」「〜において」「〜による」などの単体では意味を持たない日本語をまとめてストップワードとして登録するためのJSONファイルです。

2. ストップワード・リストをコレクションに適用する

画面右側の「Improvement tools」から「Stopwords」をクリックします。
image3.png

「Upload stopwords」をクリックし、ダウンロードしてきた「custom_stopwords_ja.json」をアップロードします。
image4.png

「Stopwords added」が表示されればOKです。

image5.png

3. 検索して確認する

先ほどと同じように「振込の限度額」というキーワードで検索をしてみます。今回は「振込」と「限度額」のキーワードで引っかかった文書のみが表示されることが確認できます。

image6.png

参考文献

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?