Skip to content

llm-newsletter-generator transforms a valid RSS feed into a "Newsletter" using AI models via PyTorch and Transformers; this is experimental.

License

Notifications You must be signed in to change notification settings

samestrin/llm-newsletter-generator

Repository files navigation

llm-newsletter-generator

Star on GitHub Fork on GitHub Watch on GitHub

Version 0.0.4 License: MIT Built with Python

llm-newsletter-generator is an experimental Python script designed to generate text-only newsletters from RSS feeds using AI via PyTorch and Transformers. AI is used to create "compelling" newsletter content based on the provided feed, title, and optional topic. llm-newsletter-generator currently processes templated prompts using configurable LLMs and summarizes with sshleifer/distilbart-cnn-12-6.

Features

  • RSS Feed Integration: The generator seamlessly retrieves content from RSS feeds, ensuring up-to-date newsletter content.
  • Customizable Output: Users can specify the title and topic of the newsletter to tailor content according to their preferences.
  • Transformer-based Text Generation: Utilizing the powerful capabilities of the Transformers library, the generator produces engaging and diverse newsletter content using multiple models.

Large Language Models

Dependencies

llm-newsletter-generator relies on the following dependencies:

  • Python: The script runs in a Python3 environment.
  • argparse: For parsing command-line arguments.
  • bs4 (BeautifulSoup): For parsing HTML content in descriptions to clean it.
  • feedparser: To parse the RSS feeds.
  • hashlib: For generating hash values, used in caching mechanisms.
  • os: To interact with the operating system, such as file path handling and checking file existence.
  • requests: To make HTTP requests to retrieve the RSS feeds.
  • rich: Used for creating progress bars and rich text formatting in the console.
  • time: To handle time-based functions, like checking cache timeouts.
  • torch: PyTorch, used by the transformers library for managing deep learning models.
  • transformers: From Hugging Face, used to load pre-trained models and pipelines for natural language processing tasks.

Installation

To install and use llm-newsletter-generator, follow these steps:

Clone the Repository: Begin by cloning the repository containing the llm-newsletter-generator to your local machine.

git clone https://github.com/samestrin/llm-newsletter-generator/

Navigate to the project directory:

cd llm-newsletter-generator

Install the required dependencies using pip:

pip install -r requirements.txt

Usage

To run the script, you need to provide two mandatory arguments: the feed (--feed-url) and the title of the newsletter (--title).

python llm_newsletter_generator.py --feed-url <feed_url> --title <newsletter_title> [--topic <newsletter_topic>] [--max <max_items>] [--output-filename <output_filename>] [--model <valid_model>]

Options

  -f, --feed-url          URL of the feed                 [string] [required]
  -t, --title             Title of the newsletter         [string] [required]
  -to, --topic            Topic of the newsletter         [string]
  --max                   Maximum number of items to      [number]
                          process
  -m, --model-name        Model to use for text           [string]
                          generation (microsoft,
                          meta-llama, snowflake,
                          dolphin)
  -o, --output-filename   Output filename                 [string]

  -v, --version           Display the version number      [boolean]

Replace <feed_url> with the URL of the RSS feed you want to generate the newsletter from. Specify <newsletter_title> as the desired title for the newsletter. Optionally, you can include <newsletter_topic> to define a specific topic for the newsletter, <max_items> to limit the number of items included in your newsletter, to specify an output filename, or <valid_model>. Valid models are: dolphin, meta-llama, microsoft, and snowflake; microsoft is the default.

Contribute

Contributions to this project are welcome. Please fork the repository and submit a pull request with your changes or improvements.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Share

Twitter Facebook LinkedIn

About

llm-newsletter-generator transforms a valid RSS feed into a "Newsletter" using AI models via PyTorch and Transformers; this is experimental.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages