No project description provided
Project description
Introduction
A module for prototyping asyncflows actions that classify data.
This repo contains a classify action, which prompts the LLM to return a classification for a piece of data, given a provided list of labels.
To use this action in your own flows, simply:
pip install asyncflows-classify
And include the action in your flow yaml file:
flow:
sentiment_analysis:
action: classify
labels:
- positive
- negative
data:
var: data
Running the Example
The repo also includes an example of how to use the classify action in sentiment analysis:
sentiment_analysis_example.yaml
, a flow that classifies a piece of data as either funky, janky, or serious, and says hello world in that waysentiment_analysis_example.py
, a script that runs the flow on a hardcoded piece of data
To run the example:
-
Set up Ollama or configure another language model
-
Clone the repository
git clone ssh://git@github.com/asynchronous-flows/asyncflows-classify
- Change into the directory
cd asyncflows-classify
- Create and activate your virtual environment (with, for example)
python3.11 -m venv .venv
source .venv/bin/activate
- If not already installed, install poetry. Install dependencies with:
poetry install
- Run the example
python sentiment_analysis_example.py
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
Close
Hashes for asyncflows_classify-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3f034c269f55cdcb4879ac384bc5ae2e36915c29924550e4e1c095d058860c2 |
|
MD5 | 075eebb4e5d5cfcb657318f018524424 |
|
BLAKE2b-256 | 067241d624528c51dd004e726be6352a99f7ca7ed1a71b121312f863a2c5bc46 |
Close
Hashes for asyncflows_classify-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80ea7abc894f24f5838712bf67b2ae6a11e7168de5853e9c2bf67f930fafedff |
|
MD5 | 6acc89df0340d51eb897fca876bf0205 |
|
BLAKE2b-256 | 1f1d1c6e0575bde0a11220085479ee36581be7ac8eab358b2e97addabfda9223 |