LoginSignup
4
1

More than 5 years have passed since last update.

Watson NLC 同一分類器で日本語 英語同時に使えるの?

Last updated at Posted at 2017-12-27

WatsonのNLCで日本語と英語同時につかえるのか?

通常NLCを使う場合、分類器を作る際に言語を選びますが、1つの分類器で複数の言語が混在した学習データに対応したいという妄想があると思います。通常は言語を判定した後に、それぞれの言語毎に学習した分類器を使うのがセオリーだと思いますが、実験してみました。

学習データ

英語:公式のデモデータ
日本語:公式のデモデータのテイストで適当に作ったもの

※クラスは2値分類(温度、天候)

評価用データ

英語:適当に作った
日本語:適当に作った

比較条件と正解率(Accuracy)評価結果

下記の条件で言語設定と学習を実施し評価用データでの評価を行った。
※特に正解率を上げる活動はしていない
※Top_classのみで判断

No 分類器の言語設定 学習データの言語 評価データ言語 正解率 独り言
1 日本語 日本語 日本語 55%  ほぼ最低値に近い
2 日本語 英語 英語 80%  2分類だしな
3 英語 英語 英語 85% これがサンプルデータの性能だ
4 英語 日本語 日本語 50% 全部天候に分類されたよ
5 日本語 日本語と英語 日本語と英語 58% タイトルの検証結果だよ

結論

  • 同時に使うのは推奨しません。
    • 今回は単純比較の数値ですが、運用時の正解率向上だったりカテゴリ追加に大変工数がかかることが想像つきます。
  • 日本語学習データが・・・
    • 単語数が少ないのが大きな要因と思われる。
  • 言語設定は正しくやりましょう。
    • No2,3 No1,4データ比較結果参照

番外編

  • No1の条件でクラス名を日本語にするのか英語にするのかで正解率としては変わらなかったが分類される結果は異なった。

評価データ

評価質問 期待クラス
Is it hot outside? temperature
What is the expected high for today? temperature
What is the temperature today? temperature
What is the temperature setting? temperature
What's the temperature going to be tomorrow? temperature
It is scorching right now. temperature
There will be a sweltering night tonight. temperature
I feel kind of chilly. Can you turn off the air-conditioner? temperature
Is it going to be hot today, isn’t it? temperature
Your air conditioner is broken? temperature
Will it be foggy tomorrow morning? conditions
Should I prepare for sleet? conditions
Will there be a storm today? conditions
How was the weather? conditions
Do you mind this cold weather? conditions
The rainy season has just started, so it is really humid. conditions
we are going to have a downpour soon. conditions
We have a stormy sky. conditions
A typhoon is coming to Japan. conditions
It will be pouring from 2:00 to 5:00. conditions
本日の福岡…寒いです 温度
今日の天気は晴時々曇で、最高気温は14度だよ~。昨日より3度高いね~ 温度
気温は最低・最高共に今日と同じくらいかやや高く、あすも朝は寒いけれど、日中は日差しが気持ち良いと思います。最高気温は12013度前後の予想です。 温度
死んでるのかと思ったよ 温度
素足が、ガラスのように冷えて透き通っている 温度
冷凍みかん 温度
ケーキが解けちゃう温度は? 温度
日本酒日向感で 温度
うっすら汗ばむ叔父さん 温度
昨日の夜は熱帯夜でしたね。 温度
ラジオで雷になると言ってた 天候
お天気お姉さんが雨が降るって 天候
稚内は猛吹雪 天候
揺れたよね? 天候
冬将軍が本気を出すそうです. 天候
台風の影響でキャンプが中止になった 天候
曇っていて流星が見れない 天候
月が出ている 天候
夕立の後は暖かい 天候
今日は狐の嫁入りだったね 天候

(参考)交差検証結果

学習データを4分割にして交差検証した結果の平均値

No1

image.png

No2

image.png

No3

image.png

No4

image.png

No5

image.png

4
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
4
1