{"id":15284140,"url":"https://github.com/jdagdelen/mondigy","last_synced_at":"2025-04-12T23:20:57.401Z","repository":{"id":57442876,"uuid":"341704114","full_name":"jdagdelen/mondigy","owner":"jdagdelen","description":"A small component for using Mongodb databases with Prodigy annotation applications. ","archived":false,"fork":false,"pushed_at":"2021-04-20T20:20:41.000Z","size":34,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T15:15:51.337Z","etag":null,"topics":["annotations","mongodb","natural-language-processing","prodigy","spacy","spacy-nlp"],"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/jdagdelen.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-02-23T22:09:28.000Z","updated_at":"2024-04-02T18:58:13.000Z","dependencies_parsed_at":"2022-09-04T22:20:57.875Z","dependency_job_id":null,"html_url":"https://github.com/jdagdelen/mondigy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdagdelen%2Fmondigy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdagdelen%2Fmondigy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdagdelen%2Fmondigy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdagdelen%2Fmondigy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdagdelen","download_url":"https://codeload.github.com/jdagdelen/mondigy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248644069,"owners_count":21138551,"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":["annotations","mongodb","natural-language-processing","prodigy","spacy","spacy-nlp"],"created_at":"2024-09-30T14:50:04.564Z","updated_at":"2025-04-12T23:20:57.379Z","avatar_url":"https://github.com/jdagdelen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## mondigy\n\nMondigy is a small library for using a Mongodb database as a data loader \nfor [Prodigy](https://prodi.gy) annotation applications.\n\n## Motivation\nProdigy naviely supports loading text data from files and dataset objects, \nbut annotating data that is stored in a MongoDB database is not natively \nsupported. \n\nWith *mondigy* you can annotate data from a MongoDB collection \nand store your annotations in a MongoDB database.\n\n## Features\n* Annotate text data from MongoDB\n* Pipe data directly from your MongoDB database to your Prodigy application\n\n\n## Installation \u0026 Setup\n\nMondigy can be installed via `pip install mondigy` or by cloning this repo and \nrunning `python setup.py` in the project root.\n\nMondigy will set up the collections it requires in your mongo database. They are \nnamed with a `_p.\u003ccollection_name\u003e`convention. Don't delete these collections or \nmanually edit any of the documents in them.\n\nTo set up mondigy, just enter your MongoDB connection info into your \n[prodigy.json config file](https://prodi.gy/docs/install#config),\nwhich is found in your `PRODIGY_HOME` directory. The source database and annotations \ndatabase (where your completed annotations are stored by Prodigy) can be configured \nindependently or the same database can be specified for both if you want everything\nin the same db. See \n[example_config/prodigy.json](https://github.com/jdagdelen/mondigy/example_config/prodigy.json)\nfor an example config file.\n\n## Code Example\nLet's define a db connection and start annotating data from our MongoDB database!\n\n*Step 1.* Add configuration parameters to `prodigy.json` in your `PRODIGY_HOME` directory. For this example, \nwe'll be limiting our annotations to the 1000 entries that are `in_stock` from the `products` collection \nof our database. We'll also include the product name and product id in the data returned to Prodigy \nso we can include that information in a custom view. .\n\n##### prodigy.json\n```\n  ...\n  \"db\": \"mondigy.db\",\n  \"db_settings\": {\n    \"mongodb\": {\n      \"source_db\": {\n        \"host\": \"my.database.com\",\n        \"user\": \"mongo_user\",\n        \"password\": \"mongo_pass\",\n        \"database\": \"my_db\",\n        \"auth_source\": \"admin\",\n        \"collection\": \"products\",\n        \"text_field\": \"description\",\n        \"other_fields\": [\"product_name\", \"product_id\"],\n        \"query\": {\"in_stock\": true},\n        \"limit\": 1000\n      },\n      \"annotations_db\": {\n        \"host\": \"my.database.com\",\n        \"user\": \"mongo_user\",\n        \"password\": \"mongo_pass\",\n        \"database\": \"my_db\",\n        \"auth_source\": \"admin\",\n      }\n    }\n  },\n  ...\n}\n```\n\n*Step 2.* Start your Prodigy server and let mondigy point your MongoDB collection at it by \nsupplying the paths of your config file and the Mondigy loader.\n\n```prodigy ner.manual my_ner_task en_core_web_sm - --label FEATURE,KEYWORD --loader mondigy.loader```\n\n\n*Step 3.* Annotate! \n\n## License\n\nMIT © [John Dagdelen](jdagdelen.github.io)\n\n## Aknowledgements\n\nThe AnnotationDatabase class is based on code originally written by [Haoyan Huo](https://github.com/hhaoyan).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdagdelen%2Fmondigy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdagdelen%2Fmondigy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdagdelen%2Fmondigy/lists"}