Skip to content

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.

Notifications You must be signed in to change notification settings

medelman17/socrates-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socrates Microservice

Socrates is a thin wrapper around an early-stage AllenNLP 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, 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.,

{
  "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:

{
  "answers": [
    {
      "question": "...your first question...",
      "answer": "...Socrates answer to your first question..."
    }
  ]
}

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published