Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
> Polonius: What do you read, my lord?
> Hamlet: Words, words, words.

A chatbot that answers in Shakespeare quotes. Live at **<https://hamlet.42labs.io>**.
[![Project Status: Inactive](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

### How it works
A chatbot that answers in Shakespeare quotes. Live at **<https://hamlet.42labs.io>**.

Flask + jQuery front end. The server picks an apt quote from `shakespeare.json` with a pre-LLM IR pipeline: [TF–IDF](https://en.wikipedia.org/wiki/Tf%E2%80%93idf) cosine similarity over a pre-computed corpus index, [Porter stemming](https://tartarus.org/martin/PorterStemmer/), [WordNet](https://wordnet.princeton.edu/) synonym expansion (NLTK), and [TextBlob](https://textblob.readthedocs.io/en/dev/) sentiment as a tiebreaker. Returns `{quote, source}`. Built in 2016, kept online as an artifact of the pre-LLM era.
> [!NOTE]
> **Unmaintained, and staying online.** Built in 2016, kept running as an artifact of
> how this was done before LLMs. Nothing here is being developed; issues and pull
> requests may sit indefinitely. The site works — that is the whole point of leaving
> it up.

### UI
### How it works

- IM-style speech bubbles: user on the right with a person avatar, Hamlet on the left with the Yorick-skull glyph.
- Header with brand mark + an info button that re-opens the welcome modal.
- Welcome modal (`Hark!`) shown once per browser via `localStorage`.
- 42labs footer (`© 2026 42LABS`).
Flask + jQuery front end. The server picks an apt quote from `shakespeare.json` with a pre-LLM IR pipeline: [TF–IDF](https://en.wikipedia.org/wiki/Tf%E2%80%93idf) cosine similarity over a pre-computed corpus index, [Porter stemming](https://tartarus.org/martin/PorterStemmer/), [WordNet](https://wordnet.princeton.edu/) synonym expansion (NLTK), and [TextBlob](https://textblob.readthedocs.io/en/dev/) sentiment as a tiebreaker. Returns `{quote, source}`.

### Run locally

Expand All @@ -25,6 +27,6 @@ pip install -r requirements.txt
flask --app app run --port 5001
```

### Deploy
### License

Hosted on Vercel (`@vercel/python` builder, `vercel.json` rewrites all routes to `app.py`). Deploy the current branch with `vercel --prod`.
[MIT](LICENSE). Do what you like with it.