Inspiration

We noticed that, although many people are aware and care about certain issues, they often do not know who their representatives are or how to contact them. We decided to create a website where that breaks this barrier where all users have to do is enter some basic information. This way, it takes no time for people to get their voices out.

What it does

From the user end, all you have to do is enter your zip code and pick a topic, and there will be a unique autogenerated email ready to send! On the back end, we'll take the zip code the user entered and parse a list of zip codes and corresponding representatives until we find the matching one. We then use the representative and selected issue and run it through Cohere to generate an email, signed by the user's name.

How we built it

We built everything using Python. The website was built with HTML and we used Cohere to generate the email after adding the variables.

Challenges we ran into

The biggest challenge we ran into is scraping the website to match a zip code and representative. This was difficult because there was a lot of HTML code that we had to dig through to find what we wanted, and we also had to keep subsetting the strings to isolate the representatives’ names. Another challenge we ran into was making sure the AI generated messages with proper formatting and without weird sentences. We mitigated this with trial and error — by testing more specific prompts until we got a proper output.

Accomplishments that we're proud of

  • Parsing a different website using the user-entered zip code to find their representative
  • Figuring out how to take advantage of Cohere's Natural Language Processing to generate emails
  • Coding a website using Python and HTML
  • Making the website design user-friendly and aesthetically pleasing

What we learned

  • How NPL works
  • How to host a website using Flask and Python anywhere
  • How HTML works and how to use Python to send emails
  • How to use the package BeautifulSoup (although we didn't end up using it)

What's next for RepWrite

Currently we created a list of ten issues that users can select from. RepWrite would reach a wider audience if we created an option for users to type any issue they would want to contact their representative about. We also would like to make the process more efficient by generating a preloaded email with the recipient, subject line, and email body so that all the user has to do is click send.

Built With

Share this project:

Updates