UiPath Documentation
ai-center
2022.4
true
AI Center ガイド
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

Custom Named Entity Recognition (カスタム固有表現抽出)

[すぐに使えるパッケージ] > [UiPath Language Analysis (UiPath 言語分析)] > [Custom Named Entity Recognition (カスタム名前付きエンティティ認識)]

このモデルでは、抽出するエンティティでタグ付けされた独自のデータセットを利用できます。トレーニング データセットと評価データセットは、CoNLL 形式または JSON 形式である必要があります。データは、 AI Center のデータ ラベル付けツールからエクスポートすることも、Label Studio からエクスポートすることもできます。この ML パッケージは再トレーニングする必要があります。最初にトレーニングを行わずにデプロイすると、モデルがトレーニングされていないことを示すエラーが表示され、デプロイが失敗します。

For an example on how to use this model, see Extracting chemicals from research paper by category for a use case.

言語

この多言語モデルでは、以下に表示する言語をサポートしています。これらの言語が選ばれた理由は、世界最大規模のインターネット百科事典 Wikipedia が対応していて、記事数も多い上位 100 の言語だからです。

  • アフリカーンス語
  • アルバニア語
  • アラビア語
  • アラゴン語
  • アルメニア語
  • アストゥリアス語
  • アゼルバイジャン語
  • バシキール語
  • バスク語
  • バイエルン語
  • ベラルーシ語
  • ベンガル語
  • ビシュヌプリヤ・マニプリ語
  • ボスニア語
  • ブルトン語
  • ブルガリア語
  • ビルマ語
  • カタロニア語
  • セブアノ語
  • チェチェン語
  • 中国語 (簡体)
  • 中国語 (繁体)
  • チュヴァシ語
  • クロアチア語
  • チェコ語
  • デンマーク語
  • オランダ語
  • 英語
  • エストニア語
  • フィンランド語
  • フランス語
  • ガリシア語
  • グルジア語
  • ドイツ語
  • ギリシャ語
  • グジャラート語
  • ハイチ語
  • ヘブライ語
  • ヒンディー語
  • ハンガリー語
  • アイスランド語
  • イド語
  • インドネシア語
  • アイルランド語
  • イタリア語
  • 日本語
  • ジャワ語
  • カンナダ語
  • カザフ語
  • キルギス語
  • 韓国語
  • ラテン語
  • ラトビア語
  • リトアニア語
  • ロンバード語
  • 低地ドイツ語
  • ルクセンブルク語
  • マケドニア語
  • マダガスカル語
  • マレー語
  • マラヤーラム語
  • マラーティー語
  • ミナンカバウ語
  • モンゴル語
  • ネパール語
  • ネワール語
  • ノルウェー語 (ブークモール)
  • ノルウェー語 (ニーノシュク)
  • オック語
  • ペルシア語 (ファールシー)
  • ピエモンテ語
  • ポーランド語
  • ポルトガル語
  • パンジャブ語
  • ルーマニア語
  • ロシア語
  • スコットランド語
  • セルビア語
  • セルビア・クロアチア語
  • シチリア語
  • スロバキア語
  • スロベニア語
  • 南アゼルバイジャン語
  • スペイン語
  • スンダ語
  • スワヒリ語
  • スウェーデン語
  • タガログ語
  • タジク語
  • タミール語
  • タタール語
  • テルグ語
  • タイ語
  • トルコ語
  • ウクライナ語
  • ウルドゥ語
  • ウズベク語
  • ベトナム語
  • ヴォラピュク
  • ワライ語
  • ウェールズ語
  • 西フリジア語
  • 西パンジャブ語
  • ヨルバ語

モデルの詳細

入力の説明

エンティティの抽出元となる、上記のいずれかの言語のテキストです。

出力の説明

テキスト内の名前付きエンティティのリストです。リストの各要素では、予測に以下の項目が含まれます。

  • 認識されたテキスト

  • テキストの開始位置と終了位置 (文字数)

  • 名前付きエンティティの型

  • 信頼度

    {
     "response" : [{
       "value": "George Washington",
       "start_index": 0,
       "end_index": 17,
       "entity": "PER",
       "confidence": 0.96469810605049133
      }]
    }
    {
     "response" : [{
       "value": "George Washington",
       "start_index": 0,
       "end_index": 17,
       "entity": "PER",
       "confidence": 0.96469810605049133
      }]
    }
    

GPUを推奨

既定では、GPU が推奨されます。

パイプライン

このパッケージでは、3 つの種類のパイプライン (フル トレーニング、トレーニング、評価) がすべてサポートされています。ほとんどのユース ケースでは、パラメーターを指定する必要がなく、モデルは高度な手法を使用して高性能なモデルを検出します。2 回目以降のトレーニングでは、モデルは増分学習を使用します (トレーニングの実行の最後で、その前にトレーニングされたバージョンが使用されます)。

検証ステーションからのデータを使用して微調整する

Label Studio API を使用して、信頼度が低いデータと予測を書き戻すことができます。その後、データを再ラベル付けして、CoNLL 形式でエクスポートできます。

For more information on how to use Label Studio, see Getting started with Label Studio. Also, you can download the UiPath Studio activity for Label Studio Integration here.

GPU または CPU に対するトレーニング

トレーニングには GPU または CPU を使用できます。より高速な GPU を使用することをお勧めします。

データセットの形式

このモデルは、すべてのパイプライン実行 (トレーニング、評価、フル パイプライン) で、指定されたディレクトリ内にあるすべてのファイルを読み取ることができます。

注:

ラベル名にスペースや特殊文字が含まれていないことを確認してください。たとえば、Set Date ではなく SetDate を使用します。

CoNLL ファイル形式

このモデルは、指定されたディレクトリにある .txt または .conll という拡張子の付いた CoNLL ファイル形式のファイルをすべて読み取ることができます。

CoNLL ファイル形式は、1 行に 1 つの単語を含むテキストの本文を表します。各単語には、単語に関する情報を示す 10 個のタブ区切り列が含まれます (表層や構文など)。

トレーニング可能な Named Entity Recognition (固有表現抽出) では、2 つの CoNLL 形式をサポートしています。

  • テキストに 2 列のみ含まれる。
  • テキストに 4 列含まれる。

この形式を使用するには、 dataset.input_format 環境変数を conll または label_studio に設定します。

注:

label_studio 形式は CoNLL 形式と同じで、2 つのデータ ポイントが新しい空の行で区切られます。-DOCSTART- -X- O O で 2 つのデータ ポイントを区切れるようにするには、dataset.input_format を環境変数として追加して、その値を conll に設定します。

詳しくは、以下の例をご覧ください。

Japan NNP B-NP B-LOC
began VBD B-VP O
the DT B-NP O
defence NN I-NP O
of IN B-PP O
their PRP$ B-NP O
Asian JJ I-NP B-MISC
Cup NNP I-NP I-MISC
title NN I-NP O
with IN B-PP O
a DT B-NP O
lucky JJ I-NP O
2-1 CD I-NP O
win VBP B-VP O
against IN B-PP O
Syria NNP B-NP B-LOC
in IN B-PP O
a DT B-NP O
Group NNP I-NP O
C NNP I-NP O
championship NN I-NP O
match NN I-NP O
on IN B-PP O
Friday NNP B-NP O
. . O OFounding O
member O
Kojima B-PER
Minoru I-PER
played O
guitar O
on O
Good B-MISC
Day I-MISC
, O
and O
Wardanceis I-MISC
cover O
of O
a O
song O
by O
UK I-LOC
post O
punk O
industrial O
band O
Killing B-ORG
Joke I-ORG
. O
Japan NNP B-NP B-LOC
began VBD B-VP O
the DT B-NP O
defence NN I-NP O
of IN B-PP O
their PRP$ B-NP O
Asian JJ I-NP B-MISC
Cup NNP I-NP I-MISC
title NN I-NP O
with IN B-PP O
a DT B-NP O
lucky JJ I-NP O
2-1 CD I-NP O
win VBP B-VP O
against IN B-PP O
Syria NNP B-NP B-LOC
in IN B-PP O
a DT B-NP O
Group NNP I-NP O
C NNP I-NP O
championship NN I-NP O
match NN I-NP O
on IN B-PP O
Friday NNP B-NP O
. . O OFounding O
member O
Kojima B-PER
Minoru I-PER
played O
guitar O
on O
Good B-MISC
Day I-MISC
, O
and O
Wardanceis I-MISC
cover O
of O
a O
song O
by O
UK I-LOC
post O
punk O
industrial O
band O
Killing B-ORG
Joke I-ORG
. O
JSON ファイル形式

環境変数を設定できます。これにより、このモデルは指定されたディレクトリにある .json という拡張子の付いた JSON ファイル形式のファイルをすべて読み取ることができます。

JSON ファイル形式の例については、次のサンプルと環境変数を確認してください。

{
    "text": "Serotonin receptor 2A ( HTR2A ) gene polymorphism predicts treatment response to venlafaxine XR in generalized anxiety disorder . anxiety disorder ( GAD ) is a chronic psychiatric disorder with significant morbidity and mortality .\)
Antidepressant drugs are the preferred choice for treatment ; however , treatment response is often variable .\)
Several studies in major depression have implicated a role of the serotonin receptor gene ( HTR2A ) in treatment response to antidepressants .\)
We tested the hypothesis that the genetic polymorphism rs7997012 in the HTR2A gene predicts treatment outcome in GAD patients treated with venlafaxine XR . Treatment response was assessed in 156 patients that participated in a 6-month open - label clinical trial of venlafaxine XR for GAD . Primary analysis included Hamilton Anxiety Scale ( HAM-A ) reduction at 6 months .\)
Secondary outcome measure was the Clinical Global Impression of Improvement ( CGI-I ) score at 6 months .\)
Genotype and allele frequencies were compared between groups using χ(2) contingency analysis .\)
The frequency of the G-allele differed significantly between responders ( 70% ) and nonresponders ( 56% ) at 6 months ( P=0.05 ) using the HAM-A scale as outcome measure .\)
Similarly , using the CGI-I as outcome , the G-allele was significantly associated with improvement ( P=0.01 ) .\)
Assuming a dominant effect of the G-allele , improvement differed significantly between groups ( P=0.001 , odds ratio=4.72 ) .\)
Similar trends were observed for remission although not statistically significant .\)
We show for the first time a pharmacogenetic effect of the HTR2A rs7997012 variant in anxiety disorders , suggesting that pharmacogenetic effects cross diagnostic categories .\)
Our data document that individuals with the HTR2A rs7997012 single nucleotide polymorphism G-allele have better treatment outcome over time .\)
Future studies with larger sample sizes are necessary to further characterize this effect in treatment response to antidepressants in GAD .",
    "entities": [{
        "entity": "TRIVIAL",
        "value": "Serotonin",
        "start_index": 0,
        "end_index": 9
    }, {
        "entity": "TRIVIAL",
        "value": "venlafaxine",
        "start_index": 81,
        "end_index": 92
    }, {
        "entity": "TRIVIAL",
        "value": "serotonin",
        "start_index": 409,
        "end_index": 418
    }, {
        "entity": "TRIVIAL",
        "value": "venlafaxine",
        "start_index": 625,
        "end_index": 636
    }, {
        "entity": "TRIVIAL",
        "value": "venlafaxine",
        "start_index": 752,
        "end_index": 763
    }, {
        "entity": "FAMILY",
        "value": "nucleotide",
        "start_index": 1800,
        "end_index": 1810
    }]
}
{
    "text": "Serotonin receptor 2A ( HTR2A ) gene polymorphism predicts treatment response to venlafaxine XR in generalized anxiety disorder . anxiety disorder ( GAD ) is a chronic psychiatric disorder with significant morbidity and mortality .\)
Antidepressant drugs are the preferred choice for treatment ; however , treatment response is often variable .\)
Several studies in major depression have implicated a role of the serotonin receptor gene ( HTR2A ) in treatment response to antidepressants .\)
We tested the hypothesis that the genetic polymorphism rs7997012 in the HTR2A gene predicts treatment outcome in GAD patients treated with venlafaxine XR . Treatment response was assessed in 156 patients that participated in a 6-month open - label clinical trial of venlafaxine XR for GAD . Primary analysis included Hamilton Anxiety Scale ( HAM-A ) reduction at 6 months .\)
Secondary outcome measure was the Clinical Global Impression of Improvement ( CGI-I ) score at 6 months .\)
Genotype and allele frequencies were compared between groups using χ(2) contingency analysis .\)
The frequency of the G-allele differed significantly between responders ( 70% ) and nonresponders ( 56% ) at 6 months ( P=0.05 ) using the HAM-A scale as outcome measure .\)
Similarly , using the CGI-I as outcome , the G-allele was significantly associated with improvement ( P=0.01 ) .\)
Assuming a dominant effect of the G-allele , improvement differed significantly between groups ( P=0.001 , odds ratio=4.72 ) .\)
Similar trends were observed for remission although not statistically significant .\)
We show for the first time a pharmacogenetic effect of the HTR2A rs7997012 variant in anxiety disorders , suggesting that pharmacogenetic effects cross diagnostic categories .\)
Our data document that individuals with the HTR2A rs7997012 single nucleotide polymorphism G-allele have better treatment outcome over time .\)
Future studies with larger sample sizes are necessary to further characterize this effect in treatment response to antidepressants in GAD .",
    "entities": [{
        "entity": "TRIVIAL",
        "value": "Serotonin",
        "start_index": 0,
        "end_index": 9
    }, {
        "entity": "TRIVIAL",
        "value": "venlafaxine",
        "start_index": 81,
        "end_index": 92
    }, {
        "entity": "TRIVIAL",
        "value": "serotonin",
        "start_index": 409,
        "end_index": 418
    }, {
        "entity": "TRIVIAL",
        "value": "venlafaxine",
        "start_index": 625,
        "end_index": 636
    }, {
        "entity": "TRIVIAL",
        "value": "venlafaxine",
        "start_index": 752,
        "end_index": 763
    }, {
        "entity": "FAMILY",
        "value": "nucleotide",
        "start_index": 1800,
        "end_index": 1810
    }]
}

前の例の環境変数は次のようになります。

  • dataset.input_format: json
  • dataset.input_column_name: text
  • dataset.output_column_name: entities
ai_center ファイル形式

これは既定の形式であり、AI Center のデータのラベル付けツールのエクスポート形式でもあります。このモデルは指定したディレクトリ内の .json の拡張子が付いたすべてのファイルを読み取ります。

ai_center ファイル形式の例については、次のサンプルと環境変数を確認してください。

{
    "annotations": {
        "intent": {
            "to_name": "text",
            "choices": [
                "TransactionIssue",
                "LoanIssue"
            ]
        },
        "sentiment": {
            "to_name": "text",
            "choices": [
                "Very Positive"
            ]
        },
        "ner": {
            "to_name": "text",
            "labels": [
                {
                    "start_index": 37,
                    "end_index": 47,
                    "entity": "Stakeholder",
                    "value": " Citi Bank"
                },
                {
                    "start_index": 51,
                    "end_index": 61,
                    "entity": "Date",
                    "value": "07/19/2018"
                },
                {
                    "start_index": 114,
                    "end_index": 118,
                    "entity": "Amount",
                    "value": "$500"
                },
                {
                    "start_index": 288,
                    "end_index": 293,
                    "entity": "Stakeholder",
                    "value": " Citi"
                }
            ]
        }
    },
    "data": {
        "cc": "",
        "to": "xyz@abc.com",
        "date": "1/29/2020 12:39:01 PM",
        "from": "abc@xyz.com",
        "text": "I opened my new checking account with Citi Bank in 07/19/2018 and met the requirements for the promotion offer of $500 . It has been more than 6 months and I have not received any bonus. I called the customer service several times in the past few months but no any response. I request the Citi honor its promotion offer as advertised."
{
    "annotations": {
        "intent": {
            "to_name": "text",
            "choices": [
                "TransactionIssue",
                "LoanIssue"
            ]
        },
        "sentiment": {
            "to_name": "text",
            "choices": [
                "Very Positive"
            ]
        },
        "ner": {
            "to_name": "text",
            "labels": [
                {
                    "start_index": 37,
                    "end_index": 47,
                    "entity": "Stakeholder",
                    "value": " Citi Bank"
                },
                {
                    "start_index": 51,
                    "end_index": 61,
                    "entity": "Date",
                    "value": "07/19/2018"
                },
                {
                    "start_index": 114,
                    "end_index": 118,
                    "entity": "Amount",
                    "value": "$500"
                },
                {
                    "start_index": 288,
                    "end_index": 293,
                    "entity": "Stakeholder",
                    "value": " Citi"
                }
            ]
        }
    },
    "data": {
        "cc": "",
        "to": "xyz@abc.com",
        "date": "1/29/2020 12:39:01 PM",
        "from": "abc@xyz.com",
        "text": "I opened my new checking account with Citi Bank in 07/19/2018 and met the requirements for the promotion offer of $500 . It has been more than 6 months and I have not received any bonus. I called the customer service several times in the past few months but no any response. I request the Citi honor its promotion offer as advertised."

前のサンプル JSON を利用するには、環境変数を次のように設定する必要があります。

  • dataset.input_formatai_center に設定
  • dataset.input_column_namedata.text に設定
  • dataset.output_column_nameannotations.ner.labels に設定

環境変数

  • dataset.input_column_name
    • テキストが含まれる列の名前です。
    • 既定値は data.text です。
    • この変数は、入力ファイル形式が ai_center または JSON の場合にのみ必要です。
  • dataset.target_column_name
    • ラベルが含まれる列の名前です。
    • 既定値は annotations.ner.labels です。
    • この変数は、入力ファイル形式が ai_center または JSON の場合にのみ必要です。
  • model.epochs
    • エポック数です。
    • 既定値は 5 です。
  • dataset.input_format
    • トレーニング データの入力形式です。

    • 既定値は ai_center です。

    • 使用できる値は ai_centerconlllabel_studiojson です。

      注:

      label_studio 形式は CoNLL 形式と同じで、2 つのデータ ポイントが新しい空の行で区切られます。-DOCSTART- -X- O O で 2 つのデータ ポイントを区切れるようにするには、dataset.input_format を環境変数として追加して、その値を conll に設定します。

成果物

評価レポートは、以下の情報を人間が読める形式で記載した PDF ファイルです。

  • 評価レポートには以下が含まれています。
    • 分類レポート
    • 混同行列
    • 適合率と再現率に関する情報
  • Separate JSON files corresponding to each section of the Evaluation Report PDF file. These JSON files are machine-readable and you can use them to pipe the model evaluation into Insights using the workflow.
分類レポート

分類レポートは、フル パイプラインまたは評価パイプラインの実行時にテスト データ セットから導き出されます。エンティティごとに以下の情報が図形式で記載されています。

  • Entity - エンティティの名前です。

  • Precision - テスト セットにおけるエンティティの正確な予測の適合率メトリックです。

  • Recall - テスト セットにおけるエンティティの正確な予測の再現率メトリックです。

  • F1 score - テスト セットにおけるエンティティの正確な予測の F1 スコア メトリックです。このスコアを使用して、このモデルの 2 つのトレーニング済みのバージョン間でエンティティ ベースのパフォーマンスを比較できます。

混同行列

混同行列の下には、各種のエラー カテゴリを説明する表も含まれています。エンティティごとのエラー カテゴリは correct (正しい)incorect (誤り)missed (見逃し)spurious (疑似) です。

適合率と再現率に関する情報

この情報を使用して、モデルの適合率と再現率のトレードオフを確認できます。しきい値とその値に対応する適合率および再現率の値も、エンティティごとに図の上の表に記載されています。この表を使用すると、ワークフローで設定するしきい値を選択し、Action Center にデータを送信して人間参加型の検証を行うべきシナリオを決定できます。選択したしきい値が大きければ大きいほど、人間参加型の検証を行うために Action Center に送信されるデータの量が増えます。

適合率と再現率の図と表はエンティティごとに用意されています。

エンティティごとの適合率と再現率の表の例は、以下のとおりです。

しきい値適合率再現率
0.50.91930.979
0.550.92240.9777
0.60.92340.9771
0.650.92560.9771
0.70.92770.9759
0.750.93190.9728
0.80.93560.9697
0.850.94120.9697
0.90.94840.9666
0.950.9570.9629

エンティティごとの適合率と再現率の図の例は、以下のとおりです。

データ

評価 CSV ファイル

これは、評価に使用するテスト セットに関する予測を含む CSV ファイルです。ファイルには、以下の列が含まれています。

  • Text - 評価に使用するテキストです。
  • Actual_entities - 評価データセット内でラベル付けされたデータとして提供されたエンティティです。
  • Predicted_entities - トレーニング済みのモデルが予測したエンティティです。
  • Error_type_counts - エラーの種類によって分類された、実際のエンティティと予測されたエンティティの違いです。

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得