{"id":37703973,"url":"https://github.com/compnet/grimbert","last_synced_at":"2026-01-16T13:05:54.915Z","repository":{"id":194574523,"uuid":"691061864","full_name":"CompNet/Grimbert","owner":"CompNet","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-20T11:51:04.000Z","size":681,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-10T05:06:22.929Z","etag":null,"topics":["nlp","novels","speaker-attribution"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CompNet.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-13T12:29:50.000Z","updated_at":"2024-12-20T11:47:45.000Z","dependencies_parsed_at":"2023-10-15T08:44:49.468Z","dependency_job_id":"888ce06e-98c2-400f-9d20-4c3fdaa25318","html_url":"https://github.com/CompNet/Grimbert","commit_stats":null,"previous_names":["compnet/grimbert"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/CompNet/Grimbert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompNet%2FGrimbert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompNet%2FGrimbert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompNet%2FGrimbert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompNet%2FGrimbert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CompNet","download_url":"https://codeload.github.com/CompNet/Grimbert/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompNet%2FGrimbert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["nlp","novels","speaker-attribution"],"created_at":"2026-01-16T13:05:54.010Z","updated_at":"2026-01-16T13:05:54.897Z","avatar_url":"https://github.com/CompNet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grimbert\n\nSpeaker attribution in novels. Based on the older [bert-quote-attribution](https://gitlab.com/Aethor/bert-quote-attribution) project.\n\n\n# Documentation\n\n```python\nfrom grimbert.model import SpeakerAttributionModel\nfrom grimbert.predict import predict_speaker\nfrom grimbert.datas import (\n    SpeakerAttributionDataset,\n    SpeakerAttributionDocument,\n    SpeakerAttributionQuote,\n    SpeakerAttributionMention\n) \nfrom transformers import BertTokenizerFast\n\n\nmodel = SpeakerAttributionModel.from_pretrained(\n\t\"compnet-renard/spanbert-base-cased-literary-speaker-attribution\"\n)\ntokenizer = BertTokenizerFast.from_pretrained(\n\t\"compnet-renard/spanbert-base-cased-literary-speaker-attribution\"\n)\n\ntokens = '\" This is horrible \" , John said to Max .'.split(\" \")\nquote_start = 0\nquote_end = 4\njohn_mention_start = 6\njohn_mention_end = 7\nmax_mention_start = 9\nmax_mention_end = 10\n\ndataset = SpeakerAttributionDataset(\n    [\n        SpeakerAttributionDocument(\n            tokens,\n            [SpeakerAttributionQuote(\n                tokens[quote_start:quote_end], quote_start, quote_end, \"John\"\n            )],\n            [\n                SpeakerAttributionMention(\n                    tokens[john_mention_start:john_mention_end],\n                    john_mention_start,\n                    john_mention_end,\n                    \"John\"\n                ),\n                SpeakerAttributionMention(\n                    tokens[max_mention_start:max_mention_end],\n                    max_mention_start,\n                    max_mention_end,\n                    \"Max\"\n                ),\n            ]\n            \n        )\n    ],\n    quote_ctx_len=512,\n    speaker_repr_nb=4, \n    tokenizer=tokenizer\n)\n\npreds = predict_speaker(dataset, model, tokenizer, batch_size=4)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompnet%2Fgrimbert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompnet%2Fgrimbert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompnet%2Fgrimbert/lists"}