{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"キーワードブロックリストによるフィルタリング","projectTitle":"Tisane Developer Documentation","description":"Tisane is an NLP platform, used for content moderation & more.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"キーワードブロックリストによるフィルタリング","__idx":0},"children":["キーワードブロックリストによるフィルタリング"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ほとんどのユーザーはTisaneを使用してコンテキストを考慮したモデレーションを行いますが、中には別の理由から単純なキーワードフィルタリングが必要になる場合もあります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Tisaneは、単語リストモニタリング時にありがちな落とし穴を避けるためのオプションを備えており、単語リストのモニタリングに使用することができます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"レスポンスに単語の詳細を含める","__idx":1},"children":["レスポンスに単語の詳細を含める"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["デフォルトでは、Tisaneは ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["abuse"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sentiment"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["entities_summary"]},"セクションのみをレスポンスに出力します。しかし、Tisaneはすべての文章を構成する単語の内訳を提供することもできます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["単語を出力するには、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["settings"]},"パラメータに",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"words\":true"]},"を追加します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["すべての単語はトークン化（チャンクに分割）されます。トークン化のアルゴリズムは言語によって異なります。その言語がスペースを使うか使わないか、複合語があるか（例：ドイツ語やオランダ語）、単語の間にスペースを取るか（例：英語の",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["kung fu"]},"、またはスペイン語の",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["EE.UU."]},"）どうかは、ユーザーに対して透過的です。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["結果は、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["words"]},"という名前の構造化された配列になります。これはレスポンス内の",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sentence_list"]},"構造内にあります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["すべての単語要素には以下のものが含まれます。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["実際の文字列（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["text"]},"）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["スタート位置である",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ストップワード用の",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["stopword"]},"フラグ"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Tisane内部IDの一部（下記オプション2を参照）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["文法や文体などの関連する特徴"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"キーワードフィルタリングの実装","__idx":2},"children":["キーワードフィルタリングの実装"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Tisaneでキーワードフィルタリングを行うには2つの方法があります。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["オプション1：シンプル（非推奨）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["オプション2：強力"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["どちらのアプローチも、「",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://en.wikipedia.org/wiki/Scunthorpe_problem"},"children":["スカンソープ問題"]},"」として知られる偽陽性の問題を防ぐことができます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"オプション1シンプル非推奨","__idx":3},"children":["オプション1：シンプル（非推奨）"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["シンプルかつ明確なソリューションは以下の通りです。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["words"]},"の配列を走査する。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["すべての要素について、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["text"]},"属性に禁止語（または表現。トークン化はロジカルであり、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["kung fu"]},"や ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["power plant"]},"は1つの単語であるため）が含まれているかどうかを確認する。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"制限","__idx":4},"children":["制限"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["シンプルさに伴う欠点："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["単語が語形変化するとどうなるでしょうか？「語幹を使えばいい」と言う人もいますが、必ずしも語幹に還元できるとは限りません。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["英語で_bought_という単語を_buy_というレンマをもとにどう捉えるのでしょうか？_b_を語幹と仮定した場合、_b_で始まる単語はすべて_buy_の活用形と仮定するのでしょうか？"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["形態論的に豊かな言語（フランス語、ドイツ語、アラビア語、ロシア語、ヒンディー語など）には、より多くの種類があり、多くの語形変化があります。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["例えば、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["USA"]},"の代わりに",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["U.S.A."]},"、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["e-mail"]},"の代わりに",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["email"]},"など、単語のスペルが微妙に違う場合はどうなるでしょうか？"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["その言葉が難読化されていたり、情報セキュリティー用語で言うところの「敵対的なテキスト操作」が施されていたらどうなるでしょうか？"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Alaska"]},"（州）に関する言及を一切排除したいが、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Alaska Air"]},"や",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["baked Alaska"]},"は認めるとしたらどうでしょうか？（最近の実例では、キーワード照合で「ゲイ」という単語にフラグが立ったため、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.newsweek.com/military-remove-enola-gay-photos-dei-rules-2041029"},"children":["2025年のペンタゴン・クリーンアップ"]},"で、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://en.wikipedia.org/wiki/Enola_Gay"},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["エノラ・ゲイ"]}]},"に関する記事が削除されました。）"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"オプション2強力","__idx":5},"children":["オプション2：強力"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["オプション2は、Tisaneの内部識別子に依存します。このルートは、Tisaneのアルゴスピークと解読能力、形態素解析能力を活用することで、上記の欠点をすべて解決することができます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["単語エントリーの内部識別子は ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lexeme"]},"と",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["family"]},"です。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"語彙素idについて","__idx":6},"children":["語彙素IDについて"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Tisaneの語彙素IDは、単語とその可能なすべての語形変化に関連付けられています。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["単語が難読化されていたり（たとえば、「break」ではなく「br*k」）、スペルミスがあった場合でも、Tisaneが元の単語を認識できた場合は、元の単語の語彙素IDが提供されます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ファミリーidについて","__idx":7},"children":["ファミリーIDについて"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ファミリーIDは、語義に従ってフィルターをかけたい場合の別のオプションです。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例：米国で「elevator」（エレベータ）と呼ばれる装置は、英国では「lift」と呼ばれます。  用語が違うだけで、現実世界では同じ存在となります。つまり、2つとも同じファミリーIDを持っていることになります。しかし、Aerodynamic lift（空力的揚力）という意味での 「lift」は、別のファミリーIDです。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["さらに、ファミリーIDは言語が違っても同じです。つまり、言語や方言に関係なく、捉えるべき「概念のリスト」を作ることができます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パワーユーザーであれば、カテゴリー別にフィルタリングすることもできます。例：どんな飛行機でも、どんな車でも、どんな鳥でも「clay pigeon」（クレーピジョン）は無視しますが、「ハト」（pigeon）は取得します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"語彙素idの使用を勧める理由","__idx":8},"children":["語彙素IDの使用を勧める理由"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Tisaneは一般的に語感を重視していますが、語感の違いはユーザーにとって必ずしも明確ではないことがわかりました。また、キーワードフィルタリングは通常、意図的にコンテキストを無視します。そのため、当社は語彙素IDを使用することをお勧めします。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リスト内のすべての単語またはフレーズについて："]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["語彙素IDを調べるには、サンプル文章を実行してそこから語彙IDを取得するか、言語モデル直接アクセスAPIを使用します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["words"]},"の配列を走査する。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["すべての単語について、語彙素IDをユーザーの語彙素IDのリストと比較します。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例："]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リクエスト（出力を簡略化するため、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sentiment"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["topics"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["entities"]},"はオフ）："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"language\":\"en\",\n  \"content\":\"d/l star t*k for free\",\n  \"settings\":\n  {\n    \"snippets\":true,\n    \"words\":true,\n    \"sentiment\":false,\n    \"entities\":false,\n    \"topics\":false\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["レスポンス："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n\t\"text\": \"d/l star t*k for free\",\n\t\"sentence_list\": [\n\t\t{\n\t\t\t\"offset\": 0,\n\t\t\t\"text\": \"d/l star t*k for free\",\n\t\t\t\"words\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"word\",\n\t\t\t\t\t\"offset\": 0,\n\t\t\t\t\t\"text\": \"d/l\",\n\t\t\t\t\t\"role\": \"verb\",\n\t\t\t\t\t\"lexeme\": 44058,\n\t\t\t\t\t\"family\": 117658,\n\t\t\t\t\t\"grammar\": [\n\t\t\t\t\t\t\"VERB\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"word\",\n\t\t\t\t\t\"offset\": 4,\n\t\t\t\t\t\"text\": \"star t*k\",\n\t\t\t\t\t\"role\": \"patient\",\n\t\t\t\t\t\"lexeme\": 317071,\n\t\t\t\t\t\"family\": 152100,\n\t\t\t\t\t\"wikidata\": \"Q1092\",\n\t\t\t\t\t\"grammar\": [\n\t\t\t\t\t\t\"PROPN\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"word\",\n\t\t\t\t\t\"offset\": 13,\n\t\t\t\t\t\"text\": \"for free\",\n\t\t\t\t\t\"lexeme\": 62119,\n\t\t\t\t\t\"family\": 93462,\n\t\t\t\t\t\"grammar\": [\n\t\t\t\t\t\t\"ADV\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"corrected_text\": \"d/l star trek for free\"\n\t\t}\n\t]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["レスポンス内："]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["_Star Trek_という難解な言葉は、"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["1つのユニットとしてまとめられる"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["割り当てられた語彙素ID 317071"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["割り当てられたファミリーID 152100"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["corrected_text"]},"属性は、_d/l star trek for free_という文の難読化解除バージョンを含みます。"]}]}]},"headings":[{"value":"キーワードブロックリストによるフィルタリング","id":"キーワードブロックリストによるフィルタリング","depth":1},{"value":"レスポンスに単語の詳細を含める","id":"レスポンスに単語の詳細を含める","depth":2},{"value":"キーワードフィルタリングの実装","id":"キーワードフィルタリングの実装","depth":2},{"value":"オプション1：シンプル（非推奨）","id":"オプション1シンプル非推奨","depth":2},{"value":"制限","id":"制限","depth":3},{"value":"オプション2：強力","id":"オプション2強力","depth":2},{"value":"語彙素IDについて","id":"語彙素idについて","depth":3},{"value":"ファミリーIDについて","id":"ファミリーidについて","depth":3},{"value":"語彙素IDの使用を勧める理由","id":"語彙素idの使用を勧める理由","depth":3}],"frontmatter":{"seo":{"title":"キーワードブロックリストによるフィルタリング"}},"lastModified":"2025-06-30T05:16:22.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/guides/how-tos/blocklists","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}