So I’m trying to create a project using transformers, datasets and gradio that is capable of scraping arabic news sites, translate articles, summarize them and then finally factcheck them.
I’ve already created all the modules necessary but now I’m kinda stuck at how I could chain all these together so I could make a simple GUI that ties it all together. My translator and summarizer modules are fine tuned models that I have uploaded to the huggingface hub but as for the fake news detector I created a tensorflow model for this purpose, saved the model and then created a predict function that would return the final result.
My code so far is:
scraper_obj = NewsScraper()
scraper = gr.Interface(fn=scraper_obj.scrape, inputs='text', outputs='text')
translator = gr.Interface.load(name='huggingface/vftnr/ArabicEnglishTranslation', api_key='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')
summarizer = gr.Interface.load(name='huggingface/vftnr/EnglishSummarization', api_key='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')
//factchecker = gr.Interface(fn=predict_news)
demo = gr.Series(scraper, translator, summarizer, factchecker)
demo.launch()
I’m kinda stuck at the fact checker line and how should I do it exactly.