import os PATH = '/data/' # at least 150GB storage needs to be attached os.environ['TRANSFORMERS_CACHE'] = PATH os.environ['HF_HOME'] = PATH os.environ['HF_DATASETS_CACHE'] = PATH os.environ['TORCH_HOME'] = PATH import gradio as gr from interfaces.cap import demo as cap_demo from interfaces.manifesto import demo as manifesto_demo from interfaces.sentiment import demo as sentiment_demo from interfaces.emotion import demo as emotion_demo from interfaces.ner import demo as ner_demo from interfaces.ner import download_models as download_spacy_models from utils import download_hf_models with gr.Blocks() as demo: gr.Markdown( f"""
This is a demo for text classification using language models finetuned on data labeled by CAP, Manifesto Project, sentiment, emotion coding and Named Entity Recognition systems.
For the coding of complete datasets, please visit the official Babel Machine site.
Please note that the sentiment (3) and emotions (6) models have been trained using parliamentary speech data, so the results for generic sentences may not be reliable. Additionally, be aware that named entity inputs are case sensitive.
The models listed for Manifesto, Sentiment (3) and Emotions (6) tasks are a beta version and thus not publicly available,
the Hugging Face link will not work for them for the time being. We expect a public version after tests and improvements in the Fall.
Please feel free to check back for model updates, or reach out to us at that point if you wish to ask about a specific model.