scikit-llm

將大型語言模型無縫整合到 scikit-learn 中。

scikit-llm 是什麼?

將大型語言模型無縫整合到 scikit-learn 中。scikit-llm 讓您輕鬆結合 LLM 與機器學習工作流程。

scikit-llm 概覽

這是什麼

Scikit-LLM 是一個開源函式庫,將大型語言模型(LLM)整合到 scikit-learn 生態系統中。它讓使用者能夠透過 scikit-learn 熟悉的 API 來應用如 ChatGPT 等模型進行文字分析任務。該專案採用 MIT 授權,由 beastbyte.ai 開發。

主要功能

  • 使用 GPT 模型(例如 GPT-4)進行零樣本文字分類 - 與 scikit-learn 的管道和估計器無縫整合 - 透過 SKLLMConfig 設定 OpenAI API 憑證 - 內建分類任務的資料集載入工具 - 支援標準的 scikit-learn 方法如 fit 和 predict

使用情境

  • 無需標記訓練資料的文字分類(零樣本) - 情感分析(正面、負面、中立) - 任何可在 scikit-learn 工作流程中利用 LLM 的文字分析任務

快速開始

安裝套件: bash pip install scikit-llm 零樣本分類快速範例: python from skllm.datasets import get_classification_dataset from skllm.config import SKLLMConfig from skllm.models.gpt.classification.zero_shot import ZeroShotGPTClassifier SKLLMConfig.set_openai_key('') SKLLMConfig.set_openai_org('') X, y = get_classification_dataset() clf = ZeroShotGPTClassifier(model='gpt-4') clf.fit(X, y) clf.predict(X) 完整文件請參閱儲存庫的 README。

授權與價格

本專案採用 MIT 開源授權。未提及價格;函式庫本身免費使用,但使用 GPT 模型需要 OpenAI API 金鑰,並可能產生相關費用。

內容整理自該專案公開的 README 與儲存庫資訊。

將此徽章加入你的 README

Featured on YunoDB 徽章樣式與說明

你是這個專案的維護者嗎?展示它已收錄於 YunoDB。

Markdown[![Featured on YunoDB](https://yunodb.com/badge/fnnx-aiscikit-llm.svg)](https://yunodb.com/tools/fnnx-aiscikit-llm?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/fnnx-aiscikit-llm?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/fnnx-aiscikit-llm.svg" alt="Featured on YunoDB" height="20"></a>