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
File details
Details for the file asyncflows_classify-0.1.2.tar.gz
.
File metadata
- Download URL: asyncflows_classify-0.1.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.3 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3f034c269f55cdcb4879ac384bc5ae2e36915c29924550e4e1c095d058860c2 |
|
MD5 | 075eebb4e5d5cfcb657318f018524424 |
|
BLAKE2b-256 | 067241d624528c51dd004e726be6352a99f7ca7ed1a71b121312f863a2c5bc46 |
File details
Details for the file asyncflows_classify-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: asyncflows_classify-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.3 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80ea7abc894f24f5838712bf67b2ae6a11e7168de5853e9c2bf67f930fafedff |
|
MD5 | 6acc89df0340d51eb897fca876bf0205 |
|
BLAKE2b-256 | 1f1d1c6e0575bde0a11220085479ee36581be7ac8eab358b2e97addabfda9223 |