- リリース ノート
- はじめる前に
- スタート アップ ガイド
- Automation Suite をインストールする
- 移行とアップグレード
- プロジェクト
- データセット
- ML パッケージ
- パイプライン
- ML スキル
- ML ログ
- AI Center での Document Understanding
- ライセンス
- 使い方
- 基本的なトラブルシューティング ガイド
[すぐに使えるパッケージ] > [UiPath Language Analysis (UiPath 言語分析)] > [Light Text Classification (ライト テキスト分類)]
テキストの分類を目的とした、一般的で再トレーニング可能なモデルです。英語、フランス語、スペイン語など、アルファベットを使用するすべての言語をサポートしています。この ML パッケージはトレーニングする必要があります。デプロイする前にトレーニングしていないと、モデルがトレーニングされていないことを示すエラーが表示され、デプロイが失敗します。このモデルは Bag of Words を使用し、n-gram に基づいた説明性を提供します。
モデルの詳細
入力の種類
JSON および CSV
入力の説明
文字列に分類されるテキスト: 'I loved this movie.'
出力の説明
クラスと信頼度 (0-1) を含む JSON。
{
"class": "7",
"confidence": 0.1259827300369445,
"ngrams": [
[
"like",
1.3752658445706787
],
[
"like this",
0.032029048484416685
]
]
}
{
"class": "7",
"confidence": 0.1259827300369445,
"ngrams": [
[
"like",
1.3752658445706787
],
[
"like this",
0.032029048484416685
]
]
}
GPU の推奨
GPU は不要です。
トレーニングが有効
既定では、トレーニングは有効化されています。
パイプライン
このパッケージは、3 種類のパイプライン (フル トレーニング、トレーニング、評価) すべてをサポートしています。このモデルでは高度な手法を使用してハイパーパラメーター検索を行い、高性能なモデルを見つけます。既定では、ハイパーパラメーター検索機能 (BOW.hyperparameter_search.enable 変数) は有効化されています。最も高性能なモデルのパラメーターは評価レポートで確認できます。
データセットの形式
Three options are available to structure your dataset for this model : JSON, CSV and AI Center JSON format. The model will read all CSV and JSON files in the specified directory. For every format, the model expects two columns or two properties, dataset.input_column_name and dataset.target_column_name by default. The names of these two columns and/or directories are configurable using environment variables.
CSV ファイル形式
各 CSV ファイルには任意の数の列を含めることができますが、モデルで使用されるのは dataset.input_column_name と dataset.target_column_name パラメーターで指定された 2 列のみです。
CSV ファイル形式の例については、次のサンプルと環境変数を確認してください。
text, label
I like this movie, 7
I hated the acting, 9
text, label
I like this movie, 7
I hated the acting, 9
前の例の環境変数は次のようになります。
- dataset.input_format:
auto - dataset.input_column_name:
text - dataset.target_column_name:
label
JSON ファイル形式
複数のデータポイントを同じ JSON ファイルに含めることができます。
JSON ファイル形式の例については、次のサンプルと環境変数を確認してください。
[
{
"text": "I like this movie",
"label": "7"
},
{
"text": "I hated the acting",
"label": "9"
}
]
[
{
"text": "I like this movie",
"label": "7"
},
{
"text": "I hated the acting",
"label": "9"
}
]
前の例の環境変数は次のようになります。
- dataset.input_format:
auto - dataset.input_column_name:
text - dataset.target_column_name:
label
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_format:
ai_center - dataset.input_column_name:
data.text - dataset.target_column_name:
annotations.intent.choices
GPU または CPU に対するトレーニング
トレーニングに GPU は不要です。
環境変数
- dataset.input_column_name
- テキストが含まれる入力列の名前です。
- 既定値は
data.textです。 - この変数は、お使いの入力 JSON または CSV ファイルに従って設定します。
- dataset.target_column_name
- テキストが含まれるターゲット列の名前です。
- 既定値は
annotations.intent.choicesです。 - この変数は、お使いの入力 JSON または CSV ファイルに従って設定します。
- dataset.input_format
- トレーニング データの入力形式です。
- 既定値は
ai_centerです。 - サポートされている値は
ai_centerまたはautoです。 ai_centerを選択した場合は、JSONファイルのみがサポートされます。また、ai_centerを選択した場合は、dataset.target_column_nameの値をannotations.sentiment.choicesに変更します。autoを選択した場合は、CoNLLファイルとJSONファイルの両方がサポートされます。
- BOW.hyperparameter_search.enable
- このパラメーターの既定値は
Trueです。有効化したままにすると、指定した期間とコンピューティング リソースにおける最も高性能なモデルを検索します。 - 試したパラメーターのバリエーションを示す PDF ファイル「
HyperparameterSearch_report」も生成されます。
- このパラメーターの既定値は
- BOW.hyperparameter_search.timeout
- ハイパーパラメーター検索を実行できる最大時間を秒単位で指定します。
- 既定値は
1800です。
- BOW.explain_inference
- このパラメーターを
Trueに設定すると、モデルを ML スキルとしてサービングする推論時に、最も重要な n-gram の一部が予測とともに返されます。 - 既定値は
Falseです。
- このパラメーターを
任意の変数
その他の任意の変数を追加するには、[Add new] ボタンをクリックします。ただし、BOW.hyperparameter_search.enable 変数を True に設定した場合、これらの変数の最適な値が検索されます。以下の任意のパラメーターが使用されるようにするには、BOW.hyperparameter_search.enable 検索変数を False に設定してください。
- BOW.lr_kwargs.class_weight
- サポートされている値は
balancedまたはNoneです。
- サポートされている値は
- BOW.ngram_range
- モデルの特徴量と見なすことができる、連続する単語のシーケンスにおけるシーケンスの長さの範囲です。
(1, x)の形式で指定します。ここでのxは許可するシーケンスの最大長を表します。
- BOW.min_df
- 特徴量と見なす基準となる、データセットにおける n-gram の最小出現回数を設定するために使用します。
- 推奨値は
0から10の間の値です。
- dataset.text_pp_remove_stop_words
- 検索に停止単語 (
the、orなどの単語) を含めるかどうかを設定するために使用します。 - サポートされている値は
TrueまたはFalseです。
- 検索に停止単語 (
成果物
評価レポートは、以下の情報を人間が読める形式で記載した PDF ファイルです。
- クラスごとの n-gram
- Precision-recall diagram
- 分類レポート
- 混同行列
- ハイパーパラメーター検索に最適なモデル パラメーター
クラスごとの n-gram
このセクションには、モデルによるそのクラスの予測に影響を与える上位 10 件の n-gram が含まれています。モデルのトレーニングに使用されたクラスごとに別々の表があります。
適合率と再現率の図
この図と表を使用して、適合率と再現率のトレードオフやモデルの F1 スコアを確認できます。しきい値とその値に対応する適合率および再現率の値は、この図の上にある表にも記載されています。この表でワークフローで設定するしきい値を選択し、Action Center にデータを送信して人間参加型の検証を行うべきシナリオを決定できます。選択したしきい値が大きければ大きいほど、人間参加型の検証を行うために Action Center に送信されるデータの量が増加します。
適合率と再現率の図はクラスごとに用意されています。
適合率と再現率の図の例は以下のとおりです。
適合率と再現率の表の例は以下のとおりです。
| 適合率 | 再現率 | しきい値 |
|---|---|---|
| 0.8012232415902141 | 0.6735218508997429 | 0.30539842728983285 |
| 0.8505338078291815 | 0.6143958868894601 | 0.37825683923133907 |
| 0.9005524861878453 | 0.4190231362467866 | 0.6121292357073038 |
| 0.9514563106796117 | 0.2519280205655527 | 0.7916427288647211 |
分類レポート
分類レポートには次の情報が含まれています。
- Label - テスト セットのラベルです。
- Precision - 予測の適合率です。
- Recall - 取得された関連インスタンスです。
- F1 score - 適合率と再現率の調和平均です。このスコアを使用して 2 つのモデルを比較できます。
- Support - テスト セットに特定のラベルが出現する回数です。
分類レポートの例については、以下の表をご覧ください。
| ラベル | 適合率 | 再現率 | F1 スコア | サポート |
|---|---|---|---|---|
| 0.0 | 0.805 | 0.737 | 0.769 | 319 |
| 1.0 | 0.731 | 0.812 | 0.77 | 389 |
| 2.0 | 0.778 | 0.731 | 0.754 | 394 |
| 3.0 | 0.721 | 0.778 | 0.748 | 392 |
| 4.0 | 0.855 | 0.844 | 0.85 | 385 |
| 5.0 | 0.901 | 0.803 | 0.849 | 395 |
混同行列
ハイパーパラメーター検索に最適なモデル パラメーター
When the BOW.hyperparameter_search.enable variable is set to True the best model parameters picked by the algorithm are displayed in this table. To retrain the model with different parameters not covered by the hyperparameter search you can also set these parameters manually in the Environment variables. For more information on this, check the Environment variables section.
このレポートの例を以下の表に示します。
| 名前 | 値 (Value) |
|---|---|
| BOW.ngram_range | (1, 2) |
| BOW.min_df | 2 |
| BOW.lr_kwargs.class_weight | balanced |
| dataset.text_pp_remove_stop_words | True |
ハイパーパラメーター検索レポート
This report is a PDF file generated only if the BOW.hyperparameter_search.enable parameter is set to True. The report contains the best values for the optional variables and a diagram to display the results.
JSON ファイル
評価レポートの PDF ファイルの各セクションに対応する、個々の JSON ファイルを利用できます。これらの JSON ファイルはマシンによる読み取りが可能であるため、ワークフローを使用してモデルの評価を Insights に追加できます。
データ
評価 CSV ファイル
これは、評価に使用するテスト セットに関する予測を含む CSV ファイルです。このファイルには予測に影響を及ぼした n-gram も含まれています (BOW.explain_inference 変数の値は問いません)。