c5c8b4b16a
Signed-off-by: Matt Williams <m@technovangelist.com> |
||
---|---|---|
.. | ||
README.md | ||
requirements.txt | ||
summ.py | ||
utils.py |
News Summarizer
This example goes through a series of steps:
- You choose a topic area (e.g., "news", "NVidia", "music", etc.).
- Gets the most recent articles on that topic from various sources.
- Uses Ollama to summarize each article.
- Creates chunks of sentences from each article.
- Uses Sentence Transformers to generate embeddings for each of those chunks.
- You enter a question regarding the summaries shown.
- Uses Sentence Transformers to generate an embedding for that question.
- Uses the embedded question to find the most similar chunks.
- Feeds all that to Ollama to generate a good answer to your question based on these news articles.
This example lets you pick from a few different topic areas, then summarize the most recent x articles for that topic. It then creates chunks of sentences from each article and then generates embeddings for each of those chunks.
You can run the example like this:
python3 -m pip install -r requirements.txt
python3 summ.py