{"id":13341707,"url":"https://github.com/i-timur/annotate-with-microdata","last_synced_at":"2025-03-11T22:31:31.285Z","repository":{"id":225408642,"uuid":"765918724","full_name":"i-timur/annotate-with-microdata","owner":"i-timur","description":"Add semantic markup to your data effortlessly","archived":false,"fork":false,"pushed_at":"2025-03-01T16:07:07.000Z","size":3339,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T17:23:03.831Z","etag":null,"topics":["deep-learning","html","html5","machine-learning","microdata","schema-org","web-of-things"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-timur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-03-01T22:00:36.000Z","updated_at":"2025-03-01T16:08:05.000Z","dependencies_parsed_at":"2024-04-05T12:24:29.077Z","dependency_job_id":"5fb1ebed-79ab-4c84-af26-c8423f6c6527","html_url":"https://github.com/i-timur/annotate-with-microdata","commit_stats":null,"previous_names":["i-timur/annotate-microdata","i-timur/annotate-with-microdata","i-timur/annotatewithmicrodata"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-timur%2Fannotate-with-microdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-timur%2Fannotate-with-microdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-timur%2Fannotate-with-microdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-timur%2Fannotate-with-microdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-timur","download_url":"https://codeload.github.com/i-timur/annotate-with-microdata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243125186,"owners_count":20240263,"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":["deep-learning","html","html5","machine-learning","microdata","schema-org","web-of-things"],"created_at":"2024-07-29T19:25:43.440Z","updated_at":"2025-03-11T22:31:31.279Z","avatar_url":"https://github.com/i-timur.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n# Annotate With Microdata\n\n## Table of contents\n- [About the project](#about-the-project-)\n- [Getting started](#getting-started-)\n  - [Prerequisites](#prerequisites-)\n  - [Installation](#installation-)\n- [Usage](#usage-)\n- [Examples](#examples-)\n- [Roadmap](#roadmap-)\n- [Contributing](#contributing-)\n- [License](#license-)\n- [Contact](#contact-)\n- [Acknowledgments](#acknowledgments-)\n\n## About the project [📌](#about-the-project-)\n\nThis project aims to provide a simple way to annotate HTML with microdata by utilizing *Deep Learning* methods.\n\nThe main motivation behind this project is to manage the tedious task of annotating HTML with microdata. Microdata is part of the WHATWG HTML Standard and is used to nest metadata within existing content on web pages. Search engines greatly benefit from microdata and boost web pages in search results.\n\nThis project is made as part of thesis work in Institute of Information Technologies and Intelligent Systems for a bachelor's degree\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Getting started [📌](#getting-started-)\n\n### Prerequisites [📌](#prerequisites-)\n\n- Python == 3.7\n- pip 24.0+\n- python3-virtualenv if running Linux\n\n### Installation [📌](#installation-)\n\n- Clone repository\n  ```shell\n  git clone git@github.com:i-timur/annotate-with-microdata.git\n  ```\n- Setup virtual environment\n  - MacOS\n    ```shell\n    python3 -m venv venv\n    source venv/bin/activate\n    ```\n  - Windows\n    ```shell\n    python3 -m venv venv\n    .\\venv\\Scripts\\activate\n    ```\n  - Linux\n    ```shell\n    virtualenv venv\n    source venv/bin/activate\n    ```\n- Install dependencies\n  ```shell\n  pip install -r requirements.txt\n  ```\n- Install [this package](https://github.com/i-timur/learnhtml)\n- Install the package globally\n  ```shell\n  pip install -e .\n  ```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Usage [📌](#usage-)\n\n### Annotate HTML with microdata\n\nHTML used for commands below requires the following minimal structure:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003ePage Title\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- Content --\u003e\n  \u003c/body\u003e\n```\n\nAnnotate HTML by passing a URL to the shell command:\n\n```shell\nmicrodata annotate https://example.com\n```\n\nor by passing a path to the file with HTML:\n\n```shell\nmicrodata annotate ./path/to/file.html\n```\n\n***IMPORTANT:*** *DO NOT* format HTML, when saving it to a file, pass it *as is*.\n\nor by passing HTML directly to the shell command *(NOT RECOMMENDED)*:\n\n```shell\nmicrodata annotate \u003cHTML\u003e\n```\n\n***IMPORTANT:*** *DO NOT* format HTML, when passing it directly to the shell command, pass it *as is*.\n\nSet output file with `--output` option:\n\n```shell\nmicrodata annotate ./path/to/file.html --output ./path/to/annotated_file.html\n```\n\nUse `--skip \u003cCLASS\u003e,\u003cOTHER_CLASS\u003e` option to skip items that are related to the specified classes:\n\n```shell\nmicrodata annotate ./path/to/file.html --skip Product,Book\n```\n\nVarious texts may have similar semantic meanings, so for situations where the user already knows \nthat certain classes have a high level of semantic similarity with other classes, \nor when the classification of a specific class is not required for other reasons, use this flag.\n\nThe confusion matrix below can give you the insight of the usage of this flag:\n\n![Confusion matrix](images/conf_matrix.jpg)\n\nThe model can misclassify a lot of entities as products.\nYou can also see that the model struggles with choosing between the book and movie entities.\nThis flag can help to avoid this issue.\n\nYou can set confidence threshold with `--threshold` option (*NOT RECOMMENDED*). The default value is 0.75.\n\nYou can also pass `--save-preprocessed` flag to save the preprocessed HTML to a file.\n\nFollowing entities are currently supported:\n\n- [X] Product\n- [X] Book\n- [X] Event\n- [X] Hotel\n- [X] JobPosting\n- [X] Movie\n- [X] Recipe\n- [X] Restaurant\n- [ ] Organization\n- [ ] Place\n- [ ] Person\n- [ ] PostalAddress\n- [ ] Creative Work\n- [ ] LocalBusiness\n- [ ] Painting\n\n## Examples [📌](#examples-)\n\n![Example 1](images/example-1.png)\n\n## Roadmap [📌](#roadmap-)\n\n- [ ] Add HTML validation\n\nSee the [open issues](https://github.com/i-timur/annotate-with-microdata/issues) for a full list of proposed features (and known issues).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Contributing [📌](#contributing-)\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## License [📌](#license-)\n\nDistributed under the MIT License. See `LICENSE.txt` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Contact [📌](#contact-)\n\nTimur - [i.timur0701@gmail.com](mailto:i.timur0701@gmail.com)\n\nProject Link: [https://github.com/i-timur/AnnotateWithMicrodata](https://github.com/i-timur/AnnotateWithMicrodata)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Acknowledgments [📌](#acknowledgments-)\n\n- [web-segment](https://github.com/liaocyintl/web-segment)\n- [bert-multilingual](https://github.com/google-research/bert/blob/master/multilingual.md)\n- [learnhtml](https://github.com/nikitautiu/learnhtml)\n- [Best-README-Template](https://github.com/othneildrew/Best-README-Template)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-timur%2Fannotate-with-microdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-timur%2Fannotate-with-microdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-timur%2Fannotate-with-microdata/lists"}