https://github.com/medelman17/socrates-api
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.
https://github.com/medelman17/socrates-api
legaltech mic nlp
Last synced: 6 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/medelman17/socrates-api
- Owner: medelman17
- Created: 2020-11-17T19:08:03.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-12T18:37:56.000Z (over 4 years ago)
- Last Synced: 2025-04-19T11:24:28.579Z (6 months ago)
- Topics: legaltech, mic, nlp
- Language: TypeScript
- Homepage: https://bs.eoir.cc/socrates/client
- Size: 17.7 MB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Socrates Microservice
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. 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.
As 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".
## Get Started
You must have Docker installed on your machine and access to the internet. Assuming the above, simply run:
`docker-compose up -d`
Running the above command starts the underlying Socrates service as well as the API layer,
which, by default, is accessible at http://localhost:8080. Note, however, as explained below,
the API layer currently does not support any GET requests. So, navigating to the address above
will return a `404-Not Found` error. No worries--check out Postman (https://www.postman.com/)
for easy programmatic access.## Routes
The 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.,
```json
{
"passage": "...the text you want to query",
"questions": ["...your first question?", "...your second question?"]
}
```If all goes well, the above route will return a JSON body in the following shape:
```json
{
"answers": [
{
"question": "...your first question...",
"answer": "...Socrates answer to your first question..."
}
]
}
```