Coder Social home page Coder Social logo

metawrap's Introduction

metawrap

metawrap is a wrapper for MetaMap. metawrap can either be used as a library, or can be run as a server to be consumed via a REST api.

To install the server:

go install github.com/hscells/metawrap/cmd/metawrap

To start the server, issue:

metawrap --path /path/to/metamap/binary

Text can be mapped fully or one can just get the matched candidates:

curl -X GET localhost:4646/mm/map --data "foo..."

curl -X GET localhost:4646/mm/candidates --data "bar..."

Note that the entire mapping is not supported, however an example response looks like:

{
  "AllDocuments": [
    {
      "Document": {
        "Utterances": [
          {
            "UttText": "A commercially available galactomannan sandwich ELISA (Platelia) was the test under evaluation.",
            "Phrases": [
              {
                "PhraseText": "A commercially available galactomannan sandwich ELISA",
                "Mappings": [
                  {
                    "MappingScore": "-740",
                    "MappingCandidates": [
                      {
                        "CandidateScore": "-637",
                        "CandidateCUI": "C0470187",
                        "CandidateMatched": "Available",
                        "CandidatePreferred": "Availability of",
                        "SemTypes": [
                          "ftcn"
                        ],
                        "Sources": [
                          "AOD",
                          "CHV",
                          "NCI",
                          "SNMI",
                          "SNOMEDCT_US"
                        ]
                      },
                      {
                        "CandidateScore": "-637",
                        "CandidateCUI": "C0060961",
                        "CandidateMatched": "Galactomannan",
                        "CandidatePreferred": "galactomannan",
                        "SemTypes": [
                          "orch"
                        ],
                        "Sources": [
                          "CHV",
                          "LNC",
                          "MSH"
                        ]
                      },
                      {
                        "CandidateScore": "-804",
                        "CandidateCUI": "C0014441",
                        "CandidateMatched": "ELISA",
                        "CandidatePreferred": "Enzyme-Linked Immunosorbent Assay",
                        "SemTypes": [
                          "lbpr"
                        ],
                        "Sources": [
                          "AOD",
                          "CHV",
                          "CSP",
                          "HL7V3.0",
                          "LCH",
                          "LCH_NW",
                          "MSH",
                          "NCI",
                          "NCI_CDISC",
                          "NCI_NCI-GLOSS",
                          "NLMSubSyn",
                          "SNMI",
                          "SNOMEDCT_US"
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "PhraseText": "(Platelia",
              },
              {
                "PhraseText": ")",
              },
              {
                "PhraseText": "was",
              },
              {
                "PhraseText": "the test under evaluation.",
                "Mappings": [
                  {
                    "MappingScore": "-819",
                    "MappingCandidates": [
                      {
                        "CandidateScore": "-819",
                        "CandidateCUI": "C0178628",
                        "CandidateMatched": "test evaluation",
                        "CandidatePreferred": "evaluation/testing",
                        "SemTypes": [
                          "resa"
                        ],
                        "Sources": [
                          "CHV",
                          "CSP",
                          "NLMSubSyn"
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  ]
}

This can be extended by modifying metawrap.go.

metawrap's People

Contributors

hscells avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

metawrap's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.