{"id":26242067,"url":"https://github.com/medelman17/socrates-api","last_synced_at":"2025-04-23T12:30:42.696Z","repository":{"id":109344712,"uuid":"313716924","full_name":"medelman17/socrates-api","owner":"medelman17","description":"Socrates is a thin wrapper around an early-stage [AllenNLP](https://allennlp.org/) model that enables machine reading comprehension (MRC) for long-form, unstructured legal text.","archived":false,"fork":false,"pushed_at":"2021-01-12T18:37:56.000Z","size":18519,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T11:24:28.579Z","etag":null,"topics":["legaltech","mic","nlp"],"latest_commit_sha":null,"homepage":"https://bs.eoir.cc/socrates/client","language":"TypeScript","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/medelman17.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":"2020-11-17T19:08:03.000Z","updated_at":"2024-06-19T06:29:46.000Z","dependencies_parsed_at":"2023-05-04T06:04:13.936Z","dependency_job_id":null,"html_url":"https://github.com/medelman17/socrates-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medelman17%2Fsocrates-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medelman17%2Fsocrates-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medelman17%2Fsocrates-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medelman17%2Fsocrates-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/medelman17","download_url":"https://codeload.github.com/medelman17/socrates-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250434381,"owners_count":21430089,"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":["legaltech","mic","nlp"],"created_at":"2025-03-13T09:42:43.127Z","updated_at":"2025-04-23T12:30:42.654Z","avatar_url":"https://github.com/medelman17.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Socrates Microservice\n\nSocrates is a thin wrapper around an early-stage [AllenNLP](https://allennlp.org/) model that enables machine reading comprehension (MRC) for long-form, unstructured legal text. In other words, given a passage of text and a list of questions related thereto, Socrates will attempt to answer the questions, using the provided text as the source of truth.\n\nAs we did with [Blackstone](https://github.com/medelman17/blackstone-api), here, we wrap Socrates with a performant API layer written in Go. Communication between Socrates and the API layer happens via gRPC. And all of the above has been containerized to facilitate deploying \"Socrates as a Microservice\".\n\n## Get Started\n\nYou must have Docker installed on your machine and access to the internet. Assuming the above, simply run:\n\n`docker-compose up -d`\n\nRunning the above command starts the underlying Socrates service as well as the API layer,\nwhich, by default, is accessible at http://localhost:8080. Note, however, as explained below,\nthe API layer currently does not support any GET requests. So, navigating to the address above\nwill return a `404-Not Found` error. No worries--check out Postman (https://www.postman.com/)\nfor easy programmatic access.\n\n## Routes\n\nThe api currently exposes a single route--**/mrc**--which accepts a POST request with a JSON body that includes a \"passage\" property (type string) and a \"questions\" property (type []string). E.g.,\n\n```json\n{\n  \"passage\": \"...the text you want to query\",\n  \"questions\": [\"...your first question?\", \"...your second question?\"]\n}\n```\n\nIf all goes well, the above route will return a JSON body in the following shape:\n\n```json\n{\n  \"answers\": [\n    {\n      \"question\": \"...your first question...\",\n      \"answer\": \"...Socrates answer to your first question...\"\n    }\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedelman17%2Fsocrates-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedelman17%2Fsocrates-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedelman17%2Fsocrates-api/lists"}