{"id":13510130,"url":"https://github.com/model-zoo/shift-ctrl-f","last_synced_at":"2025-09-28T04:30:45.258Z","repository":{"id":40649234,"uuid":"287115683","full_name":"model-zoo/shift-ctrl-f","owner":"model-zoo","description":"🔎 Search the information available on a webpage using natural language instead of an exact string match.","archived":true,"fork":false,"pushed_at":"2020-09-01T16:24:04.000Z","size":92101,"stargazers_count":1105,"open_issues_count":6,"forks_count":42,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-01-18T08:37:29.486Z","etag":null,"topics":["bert","chrome-extension","natural-language","question-answering","semantic-search","tensorflow","tensorflowjs","unpacked-extension"],"latest_commit_sha":null,"homepage":"https://modelzoo.dev","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/model-zoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-12T21:07:40.000Z","updated_at":"2025-01-16T07:40:38.000Z","dependencies_parsed_at":"2022-08-02T20:31:07.396Z","dependency_job_id":null,"html_url":"https://github.com/model-zoo/shift-ctrl-f","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/model-zoo/shift-ctrl-f","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/model-zoo%2Fshift-ctrl-f","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/model-zoo%2Fshift-ctrl-f/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/model-zoo%2Fshift-ctrl-f/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/model-zoo%2Fshift-ctrl-f/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/model-zoo","download_url":"https://codeload.github.com/model-zoo/shift-ctrl-f/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/model-zoo%2Fshift-ctrl-f/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277326282,"owners_count":25799439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-28T02:00:08.834Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bert","chrome-extension","natural-language","question-answering","semantic-search","tensorflow","tensorflowjs","unpacked-extension"],"created_at":"2024-08-01T02:01:25.227Z","updated_at":"2025-09-28T04:30:44.942Z","avatar_url":"https://github.com/model-zoo.png","language":"JavaScript","readme":"# Shift-Ctrl-F: Semantic Search for the Browser\n\n![Shift-Ctrl-F](./assets/chrome-store-banner.png)\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n[![Chrome Web Store Link](https://developer.chrome.com/webstore/images/ChromeWebStore_BadgeWBorder_v2_340x96.png)](https://chrome.google.com/webstore/detail/shift-ctrl-f-semantic-sea/alnafbdjkoiljlomnbcknehahbjoiped)\n\nSearch the information available on a webpage using\nnatural language instead of an exact string match. Uses\n[MobileBERT](https://arxiv.org/abs/2004.02984)\nfine-tuned on\n[SQuAD](https://rajpurkar.github.io/SQuAD-explorer/)\nvia [TensorFlowJS](https://www.tensorflow.org/js) to\nsearch for answers and mark relevant elements on the web page.\n\n![Shift-Ctrl-F Demo](./assets/demo.gif)\n\n**This extension is an experiment.** Deep learning models like BERT are powerful\nbut may return unpredictable and/or biased results that are tough to interpret.\nPlease apply best judgement when analyzing search results.\n\n### Why?\n\nCtrl-F uses exact string-matching to find information within a webpage. String\nmatch is inherently a proxy heuristic for the true content -- in most cases it\nworks very well, but in some cases it can be a bad proxy.\n\nIn our example above we search\n[https://stripe.com/docs/testing](https://stripe.com/docs/testing), aiming to\nunderstand the **difference between test mode and live mode**. With string\nmatching, you might search through some relevant phrases `\"live mode\"`, `\"test\nmode\"`, and/or `\"difference\"` and scan through results. With semantic search, you\ncan directly phrase your question `\"What is the difference between live mode\nand test mode?\"`. We see that the model returns a relevant result, even though\nthe page does not contain the term \"`difference`\".\n\n### How It Works\n\nEvery time a user executes a search:\n\n1. The content script collects all `\u003cp\u003e`, `\u003cul\u003e`, and `\u003col\u003e` elements on the\n   page and extracts text from each.\n2. The background script executes the question-answering model on every\n   element, using the query as the question and the element's text as the context.\n3. If a match is returned by the model, it is highlighted within the page along\n   with the confidence score returned by the model.\n\n### Architecture\n\nThere are three main components that interact via [Message\nPassing](https://developer.chrome.com/extensions/messaging) to orchestrate the\nextension:\n\n1. Popup (`popup.js`): React application that renders the search bar, controls\n   searching and iterating through the results.\n2. Content Script (`content.js`): Runs in the context of the current tab,\n   responsible for reading from and manipulating the DOM.\n3. Background (`background.js`): Background script that loads and executes the\n   TensorFlowJS model on question-context pairs.\n\n`src/js/message_types.js` contains the messages used to interact between these\nthree components.\n\n### Development\n\nMake sure you have these dependencies installed.\n\n1) [Node](https://nodejs.org/en/download/)\n2) [Yarn](https://classic.yarnpkg.com/en/docs/install)\n3) [Prettier](https://prettier.io/docs/en/install.html)\n\nThen run:\n\n```\nmake develop\n```\n\nThe unpacked extension will be placed inside of `build/`. See [Google Chrome\nExtension developer\ndocumentation](https://developer.chrome.com/extensions/getstarted) to load the\nunpacked extension into your Chrome browser in development mode.\n\n### Publishing\n\n```\nmake build\n```\n\nA zipped extension file ready for upload will be placed inside of `dist/`.\n","funding_links":[],"categories":["JavaScript","chrome-extension"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodel-zoo%2Fshift-ctrl-f","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodel-zoo%2Fshift-ctrl-f","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodel-zoo%2Fshift-ctrl-f/lists"}