Run this model with HF Jobs
Run TheAutomatedTester/locator-model on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/TheAutomatedTester/locator-model. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/TheAutomatedTester/locator-model on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use TheAutomatedTester/locator-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use TheAutomatedTester/locator-model with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('feature-extraction', 'TheAutomatedTester/locator-model');
File size: 3,054 Bytes
c8d9abc 83a5b8a c8d9abc 83a5b8a 4a3decd 83a5b8a c8d9abc 83a5b8a c8d9abc 83a5b8a c8d9abc 83a5b8a 4a3decd 83a5b8a c8d9abc 83a5b8a c8d9abc 83a5b8a c8d9abc 83a5b8a c8d9abc 83a5b8a 4a3decd 83a5b8a 4a3decd 83a5b8a 4a3decd 83a5b8a 4a3decd 83a5b8a 4a3decd 83a5b8a 4a3decd 83a5b8a 4a3decd 83a5b8a c8d9abc 83a5b8a c8d9abc 83a5b8a c8d9abc 83a5b8a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | ---
license: apache-2.0
base_model: sentence-transformers/all-MiniLM-L6-v2
library_name: transformers.js
pipeline_tag: feature-extraction
tags:
- sentence-similarity
- onnx
- web-testing
- locators
---
# Cartographer locator model
A fine-tuned [all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
for [Cartographer](https://github.com/AutomatedTester/cartographer)'s `get_element_locator`
tool. Given a plain-English description ("checkout button"), it ranks the
elements on a web page by how close their meaning is to the description.
It ships as ONNX in the layout [Transformers.js](https://huggingface.co/docs/transformers.js)
loads, with full-precision (`onnx/model.onnx`, 90 MB) and 8-bit
(`onnx/model_quantized.onnx`, 23 MB) copies. Cartographer loads the 8-bit copy.
## Using it with Cartographer
| Variable | Value |
|---|---|
| `CARTOGRAPHER_LOCATOR_MODEL` | `TheAutomatedTester/locator-model` |
| `CARTOGRAPHER_LOCATOR_MIN_SIMILARITY` | `0.44` |
Set the threshold too. This model scores on its own scale; below 0.44, a
description that matches nothing on the page can still get a confident answer.
## What the model compares
Descriptions are compared with element text in the form Cartographer's
`describeElement` writes, for example:
```
button, text: Log in
password input, placeholder: Password, name: pass
a, text: Sign up for free
```
Mean pooling, normalised embeddings, cosine similarity.
## Training
| | |
|---|---|
| Data | `training/data/train.jsonl` at commit `de8c059`: 308 descriptions on 25 pages (14 hand-written, 11 harvested from automationexercise.com, parabank.parasoft.com, demowebshop.tricentis.com and selenium.dev) |
| Rows | One per description, with the 5 wrong elements on the same page that the base model scores closest to it |
| Loss | MultipleNegativesRankingLoss (the right element must beat its 5 hard wrong elements and every other element in the batch) |
| Settings | 10 epochs, batch size 32, learning rate 2e-5, warmup 10%, seed 42 |
## Evaluation
On `training/data/eval.jsonl`: 55 descriptions and 20 unrelated ones on 8
pages, from sites not in the training data (the-internet.herokuapp.com,
quotes.toscrape.com, and a hand-built shop). Top-1 accuracy through
Cartographer's own locator code, at each model's recommended threshold:
| Matcher | Descriptive ids | Neutral ids (`el0`, `el1`, …) | Threshold |
|---|---|---|---|
| Keyword only | 22/55 | 16/55 | |
| all-MiniLM-L6-v2 (stock) | 34/55 | 28/55 | 0.50 |
| This model | 40/55 | 34/55 | 0.44 |
The highest similarity for an unrelated description was 0.41.
Both datasets are small and were written by the same person, so treat these
numbers as a smoke test rather than a benchmark. Known misses include
"sign up link" picking a Sign In button, "complete purchase" missing a
payment button, and "stop the camera" picking Start.
## Limitations
- English only.
- Trained on test-practice sites, not real production sites.
- Built to rank the elements on one page, not for general semantic search.
|