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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c4fa3df6e2b8b84dddd0f9fedf2559600902f31d50587de5d986be02d6125b1 |
|
MD5 | 271d731bb49e775800591b7dc12dcc90 |
|
BLAKE2b-256 | 9b448c0ae601c2db1e75c5392169f756e684a16f18e84e1c3df5b32b9ce6bd06 |
Close
Hashes for asyncflows_classify-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b42a23f211cc929816f020cc02d11c740c38f424d43bba04cb91392e8910a700 |
|
MD5 | 06eefb25fa8ec1a595566457c840756b |
|
BLAKE2b-256 | 0095d2d0780d9cfdeaa14890ba6431c5e984365b31caf1d10fb7d3a1653d1844 |