|
||
---|---|---|
dataManager | ||
evaluation | ||
examples | ||
gfun | ||
.gitignore | ||
example.sh | ||
infer.py | ||
main.py | ||
readme.md | ||
requirements.txt |
readme.md
gFun - RAI
Setup:
git clone https://gitea-s2i2s.isti.cnr.it/andrea.pedrotti/gfun_multimodal.git
cd gfun_multimodal
mkdir models
mkdir resources
# optional
mkdir models/category_mappers
In models
, scaricare i modelli pre-trained condivisi. La
directory models
contiene 4 subdir
metaclassifier, vgfs, vectorizer, category_mappers
. In
resources
estrarre i muse-embeddings. In
models/category_mappers
estrarre il file csv che contiene
il mapping da category label a category id (opzionale).
Inference:
Per eseguire la classificazione dei documenti:
--datapth <path/to/the/csv_file.csv> python infer.py
I risultati saranno salvati di default nella cartella
results/inference-preds
, in un file csv denominato a
seconda input file specificato in --datapath
+ il timetamp
della run (e.g., <csv_file>_<240312_13345>.csv
)
(è possibile cambiare directory di output tramite
--outdir <my/output/dir/>
)
optional arguments:
-h, --help show this help message and exit
--datapath path to csv file containing the documents to be classified
--outdir path to store csv file containing gfun predictions (default=results/inference-preds)
--category_map path to csv file containing the mapping from label name to label id [str: id] (default=models/category_mappers/rai-mapping.csv)
--nlabels number of target classes defined in the annotation schema (default=28)
--muse_dir path to muse embeddings
--trained_gfun name of the trained gfun instance