A Transformer-based SocialNLP toolkit for Farcaster
Project description
FarGlot
A Transformer-based SocialNLP toolkit for Farcaster.
Installation
pip install farglot
Examples
from farglot import CastAnalyzer
sentiment_analyzer=CastAnalyzer.sequence_analzyer_from_model_name(
hub_address="nemes.farcaster.xyz:2283",
model_name="pysentimiento/robertuito-sentiment-analysis"
)
sentiment_analyzer.predict_cast(fid=2, hash_hex="0x0bcdcbf006ec22b79f37f2cf2a09c33413883937")
# ...
sentiment_analyzer.predict_casts_by_fid(fid=2)
# [...]
Generate a Training Set from a Hub
Install the FarGlot CLI
pip install farglot[cli]
Define Training Set Columns
{
"name": "labels",
"default_value": 1 // optional
}
For multilabel classfication:
[
{
"name": "column_one",
"default_value": 1 // optional
},
{
"name": "column_two",
"default_value": 2 // optional
},
{
"name": "column_three",
"default_value": 3 // optional
}
]
Usage
farglot init
farglot set-columns-path /path/to/column_configs.json
farglot set-hub-db-path /path/to/.rocks/rocks.hub._default
farglot new-training-set --out ./data/training-set.csv
This largely is largely adapted off of pysentimiento.
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
farglot-0.1.1.tar.gz
(31.5 kB
view hashes)
Built Distribution
farglot-0.1.1-py3-none-any.whl
(48.8 kB
view hashes)