A RAG (Retrival Augmented Generation) based fully open source software which provides summaries of related news articles built using ChromaDB vector database, mixtral-8x7b-instruct-v0.1 LLM (through Replicate AI), New York Times web scraper, dhivyeshrk/bart-large-cnn-samsum Fine-Tuned model for text summarization and sentence-transformers/sentence-t5-base來自擁抱面的嵌入。
Data for different categories of news articles were obtained from the following rss-formatted files : Technology: https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml Sports: https://rss.nytimes.com/services/xml/rss/nyt/Sports.xml Science: https://rss.nytimes.com/services/xml/rss/nyt/science.xml健康:https://rss.nytimes.com/services/services/xml/rss/rss/rss/nyt/nyt/science.xml
每本新聞文章的頭條,描述和域名都是使用句子-T5基本嵌入式矢量化的,並存儲在持久的Chromadb客戶端中。與各自新聞文章的鏈接也存儲在元數據中。此外,每個域中的新聞都存儲在不同的Chromadb集合實例中,以進行有效的檢索。
Web刮擦是使用NY Times API提供的刮板完成的,該刮板僅在新聞中提供約40-60個單詞。即使使用BeautifulSoup4,也可以輕鬆繞過牆,但對其合法性不太確定。
為了及時分類,我們使用了MixTral-8x7b-Instruct-V0.1模型,因為它具有出色的功能,基於雲的複制AI執行以及輕鬆的幻覺可預防性。對於文本儀式,我們使用Facebook最初提出的HuggingFace的微調版本的BART-LARGE模型。該模型已在CNN_DailyMail數據集上進行了培訓,並在Samsum數據集上進行了進一步的調整,可在Rouge2基準測試中提高103%。這是一個相當輕的型號,大小約為1.6 GB。鏈接:https://huggingface.co/dhivyeshrk/bart-large-cnn-samsum https://replicate.com/mistralai/mixtral-8x7b-instruct-ystruct-v0.1
使用來自紐約時報API的API鍵,然後復制AI API,然後在Web_scrape_nyt.py中替換它們,並分別epcyorize_prompt.py。然後運行main.py