Memento Ask reader

The question reader behind Ask Photos in Memento, a self-hosted photo app built on Immich. It reads a photo-search question in English or romanised Hinglish and labels each word, so the app can turn the question into a search.

"beach photos with Mom in Goa last year" β†’ Mom = person, Goa = place, last year = date, beach = a thing to look for.

Labels

BIO tags over words:

Label Meaning Example
PER a person, including the asker as "I" when they're in the photo Mom, "when was I last in the mountains"
DATE a date or time span last year, 2019
PLACE where the photo was taken Goa, Toronto, Vaishno Devi
WORD something to look for in the photo beach, ramen, Mysore palace
NEW / OLD newest or oldest first latest, oldest
VIDEO videos only videos
FAV favourites only favourite

"I" in "photos I took" is not a person: the asker was behind the camera.

Files

  • model.onnx: the fine-tuned model, with 8-bit weights and a trimmed vocabulary (about 208 MB).
  • tokenizer.json: the matching trimmed tokenizer.
  • config.json: the labels.

Memento's memento-reader container loads these three files. On 2 ARM cores it takes about 11–13 ms a question and uses about 310 MB of memory.

How well it does

These are the shares of questions where every label is right, on test sets the model never saw in training:

Test Questions All right
Questions about the asker ("when was I last in …") 160 96.9%
Places not used in training 200 93.5%
More places not used in training 150 84.7%
Look-alike traps (words that resemble places or people) 150 93.3%
PhotoBench photo-search queries (English, strict scoring) test split 94.5%
Blind photo-search questions written separately 3 sets 56–79%

The blind sets count a question as wrong if any single label differs from the expected answer, including one extra search word. That makes them much stricter than the others.

Limits

  • It handles English and romanised Hinglish only. Devanagari and other scripts aren't covered.
  • It was trained for photo-search questions, not for general named-entity recognition.
  • It sometimes labels a made-up word as a place (about 7% of the look-alike trap questions).
  • It only labels words. Turning the labels into a search (names to people, dates to ranges) is Memento's own code.

Training

The model is fine-tuned from google/muril-base-cased (revision afd9f36c7923d54e97903922ff1b260d091d202f, Apache-2.0) as a token classifier. It was trained on about 23,500 photo-search questions (with 2,600 more kept aside to check it) and 6,367 public sentences:

  • most questions were generated from templates;
  • a few thousand were written by an AI with the labels inline;
  • the public sentences came from the datasets below.

The training code and data are not published.

Credits

  • MuRIL by Google, Apache-2.0: the base model.
  • Hinglish-TOP by Google Research, Apache-2.0: romanised Hinglish requests.
  • MASSIVE by Amazon, CC BY 4.0: English requests (the English part only).
  • GeoNames, CC BY 4.0: place names, as included in Immich's place data.
  • PhotoBench: used only as a test set, never for training.

Licence

Apache-2.0.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for mahesraj/memento-ask-reader

Quantized
(6)
this model