Go to file
Andrea Pedrotti ba609ee459 moved eval script 2024-03-12 13:46:10 +01:00
dataManager typos 2024-03-12 11:40:02 +01:00
evaluation moved eval script 2024-03-12 13:46:10 +01:00
examples gitignore + sample results 2024-03-12 13:41:06 +01:00
gfun moved files 2024-03-12 13:45:19 +01:00
.gitignore gitignore update 2024-03-12 13:42:30 +01:00
example.sh examples and readme 2024-03-12 13:38:49 +01:00
infer.py timestamp appended to output file name 2024-03-12 13:38:12 +01:00
main.py dataset get_name 2023-11-06 10:52:07 +01:00
readme.md examples and readme 2024-03-12 13:38:49 +01:00
requirements.txt reqs update 2023-10-05 15:43:15 +02:00

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:

python infer.py --datapth <path/to/the/csv_file.csv>

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