{"id":24973002,"url":"https://github.com/weaviate-tutorials/demo-text-search-video-captions","last_synced_at":"2025-04-11T07:49:03.457Z","repository":{"id":196854440,"uuid":"696433145","full_name":"weaviate-tutorials/DEMO-text-search-video-captions","owner":"weaviate-tutorials","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-04T07:23:11.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T05:27:30.784Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weaviate-tutorials.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-25T18:24:51.000Z","updated_at":"2024-06-17T20:38:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"71b67c78-4830-4f77-9d33-88c8dfb92ec6","html_url":"https://github.com/weaviate-tutorials/DEMO-text-search-video-captions","commit_stats":null,"previous_names":["weaviate-tutorials/demo-text-search-video-captions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaviate-tutorials%2FDEMO-text-search-video-captions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaviate-tutorials%2FDEMO-text-search-video-captions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaviate-tutorials%2FDEMO-text-search-video-captions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaviate-tutorials%2FDEMO-text-search-video-captions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weaviate-tutorials","download_url":"https://codeload.github.com/weaviate-tutorials/DEMO-text-search-video-captions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248359650,"owners_count":21090563,"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","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":["hacktoberfest"],"created_at":"2025-02-03T18:11:17.888Z","updated_at":"2025-04-11T07:49:03.432Z","avatar_url":"https://github.com/weaviate-tutorials.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caption Search\n\nThis project's origin is [here](https://github.com/weaviate/weaviate-examples/tree/main/caption%20search).\n\nThis is a demo example to show how to perform caption search using weaviate. \\\nWe will first fetch all the captions of a video and store them in weaviate. Then we will map all the indexes in that caption text to a particular time stamp at which those parts of the caption occur. We will be using [youtube-transcript-api](https://pypi.org/project/youtube-transcript-api/) to fetch the captions.\n\nhttps://user-images.githubusercontent.com/75658681/187984897-b8046504-a9d1-495e-af59-baa2004f23bd.mp4\n\nThis example uses HTML, CSS, and Js for the frontend and NodeJs for the backend. \n\n## Prerequisites\n1. Install Docker and Docker-Compose\n2. Install Node and npm\n\n## Setup instructions\n\nFollow the following steps to reproduce the example \n1. Run the following command to run the weaviate docker file \n```bash\nsudo docker-compose up -d\n``` \n\n2. Run the following command in the directory to install all required dependencies \n```bash\npip install -r requirements.txt\n``` \n5. After installing all required python packages run the following command to install all required node modules.\n```bash\nnpm install\n``` \n6. After adding data and installing modules run the following command and navigate to http://localhost:3000/, After reaching there enter the video URL and start performing Q\u0026A on that video.\n```bash\nnpm run start\n``` \n\n## Usage instructions\n\nSome descriptions about queries:- \\\nWe have majorly used only two queries for this demo\n1. Query to fetch an answer,startIndex,endIndex for a particular searched question:- This query adds an additional ask {} parameter in the Get query of weaviate. This query returns a maximum of 1 answer which is available in _additional {} field of the results. The answer with the highest certainty will be returned. More Information of this query can be found [here]([https://weaviate.io/developers/weaviate/current/graphql-references/filters.html#like-operator](https://weaviate.io/developers/weaviate/current/reader-generator-modules/qna-transformers.html)).\n```js\nclient.graphql\n    .get()\n    .withClassName('Caption')\n    .withAsk({\n      question: searched_question,\n      properties: [\"text\"],\n    })\n    .withFields('_additional { answer { hasAnswer certainty property result startPosition endPosition } }')\n    .withLimit(1)\n    .do()\n    .then(info =\u003e {\n      return info\n    })\n    .catch(err =\u003e {\n      console.error(err)\n    });\n```\n\n2. Query to fetch timestamp for particular starting index:-This query uses the where filter provided in weaviate which allows us to perform various arithmetic comparisons. More information about the Where filter can be found [here](https://weaviate.io/developers/weaviate/current/graphql-references/filters.html#where-filter). For this example we used the GreaterThan operator of the Where filter which allows us to filter the results which are greater than a certain threshold. More information on the GreaterThan operator can be found [here](https://weaviate.io/developers/weaviate/current/graphql-references/filters.html#where-filter).\n```js\nclient.graphql\n    .get()\n    .withClassName('Timestamps')\n    .withFields(['startIndex', 'time'])\n    .withLimit(1)\n    .withWhere({\n      operator: 'GreaterThan',\n      path: ['endIndex'],\n      valueNumber: parseInt(start_index)\n    })\n    .withSort([{ path: ['startIndex'], order: 'asc' }])\n    .do()\n    .then(info =\u003e {\n      return info;\n    })\n    .catch(err =\u003e {\n      console.error(err)\n    })\n```\n\n## Dataset license\n(TO DO) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaviate-tutorials%2Fdemo-text-search-video-captions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweaviate-tutorials%2Fdemo-text-search-video-captions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaviate-tutorials%2Fdemo-text-search-video-captions/lists"}