Skip to main content

kouchou-ai-analysis-core

広聴AIの分析パイプラインコアライブラリ。

概要

このパッケージは、コメントデータを分析し、クラスタリングと要約を行うパイプラインを提供します。

必要条件

  • Python 3.12以上

インストール

pip install 'kouchou-ai-analysis-core[embeddings,clustering]'

Geminiサポートを含める場合:

pip install 'kouchou-ai-analysis-core[gemini,embeddings,clustering]'

軽量な base install だけ欲しい場合:

pip install kouchou-ai-analysis-core

この場合でも import analysis_core や dry-run はできますが、local embedding や hierarchical clustering を実行するには対応する extras が必要です。

使用方法

詳細なチュートリアルは以下を参照してください:

CLI

kouchou-analyze --config config.json

CLI の canonical output は hierarchical_result.json です。既定ではローカル確認用の補助 HTML として report.html も生成しますが、これは保存・配信の対象ではありません。

ライブラリとして

from analysis_core import PipelineOrchestrator, PipelineConfig

config = PipelineConfig.from_json("config.json")
orchestrator = PipelineOrchestrator.from_dict(config.to_dict())
result = orchestrator.run_default()

run_default() が current の canonical path です。run() も残っていますが、legacy direct-step 実行経路として deprecated 扱いです。

プラグインシステム

analysis-core は拡張可能なプラグインアーキテクチャを採用しています。

カスタムプラグインの作成

from analysis_core.plugin import step_plugin, StepContext, StepInputs, StepOutputs

@step_plugin(
    id="mycompany.custom_step",
    version="1.0.0",
    inputs=["arguments"],
    outputs=["custom_result"],
)
def custom_step(ctx: StepContext, inputs: StepInputs, config: dict) -> StepOutputs:
    # カスタム処理
    output_path = ctx.output_dir / "custom_result.csv"
    return StepOutputs(artifacts={"custom_result": output_path})

外部プラグインの配置

plugins/analysis/
└── my-plugin/
    ├── manifest.yaml
    └── plugin.py

詳細は プラグイン開発ガイド を参照してください。

開発

# 依存関係のインストール
pip install -e ".[dev,embeddings,clustering]"

# テストの実行
pytest

# リンターの実行
ruff check .

ライセンス

広聴AI本体と同じ GNU Affero General Public License v3 (AGPL-3.0) です。 ライセンス全文は LICENSE を参照してください。

以前のREADMEとパッケージメタデータ(PyPI 0.1.0 / 0.1.2を含む)のMIT表記は誤りです。 analysis-core の独立パッケージ化は、ライセンスをMITへ変更するものではありません。

Metadata

Release files for kouchou-ai-analysis-core 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kouchou-ai-analysis-core 0.1.3
File Size Uploaded
kouchou_ai_analysis_core-0.1.3.tar.gz 146.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kouchou-ai-analysis-core 0.1.3
File Interpreter ABI Platform
kouchou_ai_analysis_core-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 286.0 kB

Release files / kouchou_ai_analysis_core-0.1.3.tar.gz

Download URL kouchou_ai_analysis_core-0.1.3.tar.gz
Size 146.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9b5238abc4b2d2e58f8faa059c594f658d5131f8fc732c114464cc2639a63be1
BLAKE2b-256 checksum
How to use checksums
39ebce7095999168fc7d9dce5c6aff28cd7df496e94d5784469d6d0047e0597a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kouchou_ai_analysis_core-0.1.3-py3-none-any.whl

Download URL kouchou_ai_analysis_core-0.1.3-py3-none-any.whl
Size 139.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d1b68c003252a4a277b1924229f1c8e047a9eb53f3f8926e05565fa460fa8dc
BLAKE2b-256 checksum
How to use checksums
4f5322db201b9b6c833fc6d221925e8c4398de8260fcafeeae60b482238abe0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page