codeforboston / maple

MAPLE makes it easy for anyone to view and submit testimony to the Massachusetts Legislature about the bills that will shape our future.
https://mapletestimony.org
MIT License
44 stars 118 forks source link

Llm features #1631

Open pranay8297 opened 3 weeks ago

pranay8297 commented 3 weeks ago

Massachusetts Legislative Bill Analysis

This repository contains code for summarizing and tagging Massachusetts Legislative bills using LLMs.

Overview

The main functionality is implemented in demo_app_functions.py, which provides methods for:

  1. Summarizing bills
  2. Categorizing bills
  3. Tagging bills with relevant topics

Files

Key Features

Requirements

Usage

To use the main functions:

from demo_app_functions import get_summary_api_function, get_tags_api_function

# For summarization
summary = get_summary_api_function(bill_id, bill_title, bill_text)

# For tagging
tags = get_tags_api_function(bill_id, bill_title, bill_text)

Note

This project is designed to work with Massachusetts legislative bills and may require specific data sources or API access for full functionality.

For more detailed information on each module and function, please refer to the individual file docstrings.

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maple-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 0:10am
nesanders commented 2 days ago

We agreed with @mvictor55 @pranay8297 @AnnaKSteele tonight that we want to implement the following configuration by default,

pranay8297 commented 2 days ago

Instead of 2 API functions, create one API function to get summaries and tags

Internal Details Chronological order of things:

  1. Generate Summary
  2. Use the generated summaries and all the tags to prompt the model to choose tags with updated instructions
  3. return tags and summaries