Skip to content

v1.2 — Published accuracy, sturdier Japanese, safe updates / 精度の公開・日本語の堅牢化・安全な更新

Latest

Choose a tag to compare

@dr-yakumo dr-yakumo released this 05 Oct 14:43

🎭 Yakumo.AffectEngine v1.2

Emotion analysis library for .NET 8 — understands Japanese and English feelings in text.
Includes a one-shot installer and an interactive sample app (both with selectable English / Japanese interfaces).

.NET 8 向け感情分析ライブラリです。
ワンショットインストーラーと対話型サンプルアプリ(いずれも日英UI切替対応)を同梱しています。

v1.2 publishes measured accuracy for the first time and pins the model revisions, so every installation gets exactly the weights the scores were measured with. See "Changes in v1.2" at the end for details.

v1.2 では初めて精度の測定結果を公開し、モデルのリビジョンを固定しました。どの環境にも、スコアを測定したときと同じ重みが導入されます。詳細は末尾の「v1.2 の変更点」を参照してください。


⬇️ Download / ダウンロード

Yakumo.AffectEngine-v1.2.zip (12.8 MB)

You can also find it under Assets at the bottom of this page. Then see "Getting Started" below.

ページ下部の Assets からも取得できます。取得したら、下の「はじめかた」へ進んでください。

📊 Accuracy / 精度

Macro-F1 = 0.6976 / Top-3 = 0.8591 — 14 labels, 504 Japanese sentences / 14ラベル・日本語504文

Measured on a held-out set of sentences with explicit emotion expressions, balanced across the 14 labels, with the bundled default configuration. The set is not comparable with classifiers that use a different number of labels, and scores are much lower for implicit expressions. Please read the Accuracy section of the README before quoting these figures — it lists the measurement conditions, the verified environment and the known limitations.

感情が明示的に表れた文で構成した、調整に使っていないテストセット(14ラベル均等)で、同梱の既定構成のまま測定しました。ラベル数の異なる分類の数値とは比較できず、暗示的な表現では大きく下がります。この数値を引用する前に、README の精度の節をお読みください。 測定条件・検証済みの環境・既知の限界を記載しています。

The bundled dictionaries were checked against the evaluation data, so that no entry was written to fit it.

同梱の辞書は評価データと照合し、評価データに合わせて作られた項目が無いことを確認しています。

📦 What's in the ZIP / ZIP の内容

File / ファイル Description / 説明
Yakumo.Affect.Sample.exe + runtime files Interactive sample app (built) / 対話型サンプルアプリ(ビルド済み)
Yakumo.Affect.PolarityGate.dll Polarity Gate plugin (binary-only, Apache 2.0, enabled by default) / 極性ゲートプラグイン(バイナリのみ・Apache 2.0・既定で有効)
install.bat / install.ps1 Installer — downloads models & sets up Python deps / インストーラー(モデル取得・Python 環境構築)
uninstall.bat / uninstall.ps1 Uninstaller / アンインストーラー
scripts/ Helper scripts called by the installer (model fetch with a pinned revision, fp16 export, embedding model setup) / インストーラーが使う補助スクリプト(リビジョン固定でのモデル取得・fp16 変換・埋め込みモデルの準備)
affect.config.default Configuration template (EN/JP commented) / 設定テンプレート(英日コメント付き)
affect.dict.json.example Translation dictionary template / 翻訳辞書テンプレート
requirements.txt Python packages for the translation server / 翻訳サーバー用の Python パッケージ
docs/YAKUMO_NLI_API_en.md / _jp.md Public API reference (EN/JP) / 公開 API リファレンス(英/日)
LICENSE / LICENSE_PolarityGate / NOTICE_PolarityGate Licenses (MIT core / Apache 2.0 plugin) / ライセンス一式
THIRD-PARTY-NOTICES.txt License texts of the redistributed binaries / 同梱バイナリのライセンス全文

SHA-256 of the ZIP / ZIP の SHA-256:
32d518a026de21f1dcbdb17506c293598df2856bcd5eff24b4ffbba047a61049

🚀 Getting Started / はじめかた

  1. Download and extract Yakumo.AffectEngine-v1.2.zip

    Yakumo.AffectEngine-v1.2.zip をダウンロードして展開

  2. Run install.bat (downloads the ONNX models and installs Python packages — internet connection required)

    install.bat を実行(ONNX モデルの取得と Python パッケージの導入を行います — 要インターネット接続)

  3. Launch Yakumo.Affect.Sample.exe and type Japanese or English text

    Yakumo.Affect.Sample.exe を起動して日本語・英語のテキストを入力

⚠️ Note: If Windows Explorer has file extensions hidden, install.bat and install.ps1 may look identical (both shown as "install"). Make sure you double-click the .bat one — double-clicking install.ps1 by itself does nothing harmful, it just opens the script as text in Notepad instead of running it.

注記: エクスプローラーで拡張子が非表示になっていると、install.bat と install.ps1 が同じ「install」という名前に見えてしまいます。ダブルクリックするのは .bat の方にしてください。install.ps1 を誤ってダブルクリックしても実害はなく、実行はされずメモ帳でスクリプトのテキストが開くだけです。

⏱️ Note: The first launch takes extra time while the local translation server loads its model.

注記: 初回起動時は翻訳サーバーのモデルロードのため時間がかかります。

📋 Requirements / 動作要件

  • Windows + .NET 8.0 Runtime
  • Python 3.9+ (for Japanese translation; the published scores were measured with 3.11.5) / Python 3.9 以上(日本語翻訳に必要。公表スコアの測定は 3.11.5)
  • Microsoft Visual C++ Redistributable (x64) — the installer offers automatic setup / インストーラーから自動導入できます
  • Optional: DirectML-compatible GPU (any DirectX 12 device; CUDA not required) / 任意: DirectML 対応 GPU(DirectX 12 対応であればよく、CUDA は不要)

📖 Documentation / ドキュメント

⚖️ Licenses / ライセンス

  • Core library (Yakumo.Affect): MIT
  • Polarity Gate plugin (Yakumo.Affect.PolarityGate.dll): Apache 2.0 (binary-only / バイナリのみ配布)
  • Redistributed third-party binaries: see THIRD-PARTY-NOTICES.txt in the ZIP / 同梱している第三者バイナリは ZIP 内の THIRD-PARTY-NOTICES.txt を参照

Models are not bundled — install.ps1 downloads them from their original distributors, so each is governed by the license its distributor publishes. See the README for the list.

モデルは同梱していません。install.ps1 が各配布元から取得するため、適用される条件は各配布元が公開するライセンスに従います。一覧は README を参照してください。

Translation model / 翻訳モデル
opus — Helsinki-NLP/opus-mt-ja-en Default and the only supported choice / 既定かつサポート対象
nllb — facebook/nllb-200-distilled-600M ⚠️ Published as non-commercial only (CC-BY-NC-4.0) / 非商用限定(CC-BY-NC-4.0)で公開されています
mt5 — google/mt5-small Experimental; currently produces no usable output / 実験的。現状まともな翻訳を出力しません

⚠️ Known Notes / 既知の注意点

  • Windows only in this release / 本リリースは Windows 専用です
  • install.bat(install.ps1) requires an internet connection to download the models (~1 GB+) / モデルのダウンロードに要インターネット接続(1GB超)
  • Sentences with no emotion words, where the behaviour itself carries the feeling, are not handled well; the engine tends to return neutral for them. See the README's Accuracy section / 感情語を使わず行動が感情を表す文はうまく扱えず、中立を返す傾向があります。README の精度の節を参照してください

🔄 Changes in v1.2 / v1.2 の変更点

Accuracy and reproducibility / 精度と再現性

  • Published measured accuracy in the README, with the measurement conditions, the verified environment and the known limitations.

    README に精度の測定結果を掲載しました。測定条件・検証済みの環境・既知の限界もあわせて記載しています。

  • Pinned the model revisions: the emotion model (SamLowe/roberta-base-go_emotions) is fetched at a fixed revision before ONNX export, and the translation model (Helsinki-NLP/opus-mt-ja-en) is loaded at a fixed revision. Every installation now gets exactly the weights the scores were measured with, even if the upstream repositories change.

    モデルのリビジョンを固定しました。感情モデル(SamLowe/roberta-base-go_emotions)は固定したリビジョンで取得してから ONNX に変換し、翻訳モデル(Helsinki-NLP/opus-mt-ja-en)も固定したリビジョンで読み込みます。上流が更新されても、スコアを測定したときと同じ重みが導入されます。

  • The translation server now prints a notice at start-up when the installed transformers differs from the verified version. It does not stop. requirements.txt deliberately sets no upper bounds, so that Yakumo does not hold back other tools in the same Python environment.

    インストールされている transformers が検証済みの版と異なる場合、翻訳サーバーの起動時に告知を表示するようにしました(起動は止めません)。同じ Python 環境の他のツールを妨げないよう、requirements.txt には意図的に上限を設けていません。

Translation robustness / 翻訳の堅牢化

  • When translation collapses into a subtitle sound tag such as (Laughter), the engine now returns neutral instead of reporting a false "joy".

    翻訳が (Laughter) のような字幕の効果音表記だけになってしまった場合、誤って「喜び」と判定せず、中立を返すようにしました。

  • Kaomoji and emoji are now removed before translation, as they could make the translation drop the whole sentence.

    顔文字・絵文字を翻訳の前に除去するようにしました。混ざっていると、翻訳で文全体が失われることがあったためです。

Engine and API / エンジンと API

  • Fixed the promotion logic so that every promotion evaluates the top label as it was before any promotion. Previously an earlier promotion could prevent a later one from ever firing.

    昇格ロジックを修正し、すべての昇格が「昇格前の1位」を基準に判定するようにしました。以前は先に動いた昇格が、後の昇格の条件を成立させなくすることがありました。

  • Added the Classified event, raised once per completed analysis. It lets you capture the translated text and find inputs whose emotion was lost in translation. The library itself records nothing. See section 9.5 of the API reference.

    分析が1件完了するたびに発火する Classified イベントを追加しました。翻訳後の英文を受け取れるので、翻訳で感情が失われた入力を見つけられます。ライブラリ自身は何も記録しません。API リファレンスの 9.5 を参照してください。

  • The mt5 translation option is now marked as experimental and unsupported in the installer and the configuration template.

    翻訳モデル mt5 を、インストーラーと設定テンプレートで「実験的・動作未保証」と明記しました。

Installer and files / インストーラーとファイル

  • Updating no longer puts your own files at risk. When affect.config or affect.dict.json already exists, the installer first copies it to backups\<date-time>-<number>\, then asks whether to keep it. Keeping is the default (just press Enter); answer n to replace it with the v1.2 version. Replacing the dictionary was not possible before.

    更新の際に、利用者のファイルが失われないようにしました。affect.config や affect.dict.json が既にある場合、インストーラーはまず backups\<日時>-<番号>\ に複製してから、保持するかどうかを尋ねます。既定は保持で、Enter を押すだけで今のまま使えます。n と答えると v1.2 の版で入れ直します(辞書の入れ直しは今回から可能になりました)。

  • The uninstaller now also backs up affect.config to backups\ (previously an earlier affect.config.bak was overwritten on a second run), and shows what it removed and what it kept. It cleans up the downloaded models and the configuration; to remove everything, delete the folder itself.

    アンインストーラーも affect.config を backups\ にバックアップするようにしました(以前は、2回目の実行で前回の affect.config.bak が上書きされていました)。削除したもの・残したものも表示します。アンインストーラーが片付けるのはダウンロードしたモデルと設定ファイルで、すべて削除するにはフォルダごと削除してください。

  • The installer's completion screen has a new look.

    インストール完了画面のデザインを新しくしました。

  • sacremoses is now included in the fallback package install. It is required by the translation tokenizer; without it the translation output differs.

    requirements.txt が無い場合の代替インストールに sacremoses を追加しました。翻訳のトークナイザーに必要で、無いと翻訳結果が変わります。

  • Added scripts/export_goemo_fp16.py for the -Gpu install option (fp16 model generation).

    -Gpu オプション用の scripts/export_goemo_fp16.py(fp16 モデルの生成)を追加しました。

  • Revised the sample dictionary (affect.dict.json.example) and updated the API references (English / Japanese).

    サンプル辞書(affect.dict.json.example)を見直し、API リファレンス(英語・日本語)を更新しました。

  • The core library and the sample app now report version 1.2 in their file properties.

    コアライブラリとサンプルアプリのファイルのプロパティに、バージョン 1.2 が表示されるようにしました。

Upgrading from v1.1.x / v1.1.x からの更新

  1. Extract the v1.2 ZIP into your existing folder, replacing the files. (Windows Explorer suggests a new folder named after the ZIP — change the destination to your existing folder.) Your affect.config, affect.dict.json and models are not in the ZIP, so they are not overwritten.

    v1.2 の ZIP を既存のフォルダに上書きで展開します(エクスプローラーは ZIP の名前で新しいフォルダを提案するので、展開先を既存のフォルダに変えてください)。affect.config・affect.dict.json・モデルは ZIP に入っていないため、上書きされません。

  2. Run install.bat. Press Enter at the two questions to keep your settings and dictionary — they are backed up to backups\ first either way.

    install.bat を実行します。2つの質問に Enter で答えれば、設定と辞書はそのまま残ります(どちらを選んでも、先に backups\ へバックアップされます)。

The model weights are unchanged: the revisions pinned in v1.2 are the same weights that v1.1.x installed, so the installer reuses your existing models without downloading them again.

モデルの重みは変わっていません。v1.2 で固定したリビジョンは v1.1.x が導入したものと同じ重みなので、インストーラーは既存のモデルをそのまま使い、取得し直しません。

data\mapping\label_mapping.json from v1.1.x is no longer used and can be deleted.

v1.1.x の data\mapping\label_mapping.json は使われなくなったので、削除して構いません。

Release package / リリースパッケージ

  • The v1.1.1 ZIP has been removed now that v1.2 supersedes it.

    v1.2 で置き換えたため、v1.1.1 の ZIP は削除しました。