{"id":14155192,"url":"https://github.com/sno2/bertml","last_synced_at":"2025-04-14T00:35:38.184Z","repository":{"id":46081568,"uuid":"428096271","full_name":"sno2/bertml","owner":"sno2","description":"Use common pre-trained ML models in Deno!","archived":false,"fork":false,"pushed_at":"2021-11-21T06:49:58.000Z","size":74,"stargazers_count":18,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T14:51:50.102Z","etag":null,"topics":["bert","deno","machine-learning","nlp","rust"],"latest_commit_sha":null,"homepage":"https://deno.land/x/bertml","language":"TypeScript","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/sno2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-15T02:21:17.000Z","updated_at":"2024-10-16T01:52:47.000Z","dependencies_parsed_at":"2022-09-03T20:10:58.404Z","dependency_job_id":null,"html_url":"https://github.com/sno2/bertml","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sno2%2Fbertml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sno2%2Fbertml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sno2%2Fbertml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sno2%2Fbertml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sno2","download_url":"https://codeload.github.com/sno2/bertml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248802404,"owners_count":21163841,"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":["bert","deno","machine-learning","nlp","rust"],"created_at":"2024-08-17T08:02:25.891Z","updated_at":"2025-04-14T00:35:38.162Z","avatar_url":"https://github.com/sno2.png","language":"TypeScript","readme":"# bertml\n\nHigh-level non-blocking Deno bindings to the\n[`rust-bert` machine learning crate](https://crates.io/crates/rust-bert).\n\n## Guide\n\n### Introduction\n\nThe `ModelManager` class manages the FFI bindings and all of your models that\nconnect to the bindings. You create models from the manager and then use the\nmethods on those classes. The creation of a `ModelManager` is synchronous as the\nloading of binaries with the Deno FFI API is synchronous. Therefore, make sure\nyou create your `ModelManager` before asynchronous logic begins to not cause any\nunexpected behavior.\n\n```ts\nconst manager = await ModelManager.create();\n```\n\n## Creating Models\n\nTo create models, simply call the corresponding `create*Model` method on the\n`ModelManager` class and store the model as a variable. For this example, we'll\nbe creating a question answering model:\n\n```ts\nconst manager = await ModelManager.create();\n\nconst qaModel = await manager.createQAModel();\n\nconst answers = await qaModel.query({\n  questionGroups: [\n    {\n      context: \"Amy lives in Canada.\",\n      question: \"Where does Amy live?\",\n    },\n  ],\n});\n\nconsole.log(answers);\n```\n\nOutput:\n\n```\n[ [ { score: 0.985611081123352, start: 13, end: 19, answer: \"Canada\" } ] ]\n```\n\nIf you need to learn more about creating instances of models, then simply check\nout the docs.\n\n### Supported Pipelines\n\n\u003e Note: we do not currently support any model-level configuration except for the\n\u003e different languages for the `TranslationModel`.\n\n- `SummarizationModel`\n- `ConversationModel`\n- `TranslationModel`\n- `NERModel`\n- `QAModel`\n- `SentimentModel`\n- `POSModel`\n- `ZeroShotClassificationModel`\n- `TextGenerationModel`\n\nTo test out these pipelines, you can try and run the `dev.ts` file. However,\nthis will automatically install the necessary models so I advise you comment out\nthe models you don't want to download.\n\n### [`rust-bert` citations](https://github.com/guillaume-be/rust-bert#citation)\n\n```\n@inproceedings{becquin-2020-end,\n    title = \"End-to-end {NLP} Pipelines in Rust\",\n    author = \"Becquin, Guillaume\",\n    booktitle = \"Proceedings of Second Workshop for NLP Open Source Software (NLP-OSS)\",\n    year = \"2020\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://www.aclweb.org/anthology/2020.nlposs-1.4\",\n    pages = \"20--25\",\n}\n```\n\n### Acknowledgements\n\n`rust-bert` loads the models from [Hugging Face](https://huggingface.co/) and\n`bertml` also has a huge thanks to [Hugging Face](https://huggingface.co/) for\nmaking these models public and interfaceable with Rust (+ Deno).\n\n### License\n\n[MIT](./LICENSE)\n","funding_links":[],"categories":["rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsno2%2Fbertml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsno2%2Fbertml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsno2%2Fbertml/lists"}