Пакет, содержащий класс для разметки данных, используя большие языковые модели
Project description
Usage example
from pydantic import BaseModel
from kozhindev_data_labeler import LLMClient
from kozhindev_data_labeler import LLMProcessor
class Step(BaseModel):
explanation: str = Field(..., description="Объяснение промежуточного вывода")
think: str = Field(..., description="Анализ промпта и предыдущего шага, согласование рассуждений")
class PredictLLm(BaseModel):
steps: list[Step] = Field(..., description="Пошаговое рассуждение")
message: str = Field(..., description="Краткий итог рассуждений")
target: str = Field(..., description="Классификация отзыва")
llm_client = LLMClient(
model='gpt-4o-mini',
api_key='API_KEY',
system_prompt='SYSTEM PROMPT'
response_format=PredictLLm
)
llm_processor = LLMProcessor(model_client=llm_client)
llm_processor.run(
'ОТЗЫВ',
'Сделай классификацию отзыва. 1 - негативный, 0 - положительный'
)
print(f'Ответ от модели: {llm.result}')
llm_processor.token_info() # Выведет информацию о потраченных токенах
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kozhindev_data_labeler-0.0.2.tar.gz.
File metadata
- Download URL: kozhindev_data_labeler-0.0.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e8ba2d110c88ef4d652724952443667c6f0328d7e82d3f95b82e976eaf75622
|
|
| MD5 |
ab564a90ab3c8158424bdcb396212101
|
|
| BLAKE2b-256 |
59ee3bb39af9d8e8216991eb7ed9397a5714c2a32ac3335cfe31049f47c7159d
|
File details
Details for the file kozhindev_data_labeler-0.0.2-py3-none-any.whl.
File metadata
- Download URL: kozhindev_data_labeler-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caa210514df392fdfd591bb5d8f648dc0aad21d7b9049def2ba11475da1b94d7
|
|
| MD5 |
1a7122342ef6a076b2dd2f6ee10fcc92
|
|
| BLAKE2b-256 |
b4e36b17248b66d5f9c2ba9ee924afc2d64e5ee38025ccbee18799718494d37c
|