GithubHelp home page GithubHelp logo

mpds-io / optimade-mpds-nlp Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 0.0 64 KB

Free-form search terms translation into the Optimade query language

License: MIT License

JavaScript 100.00%
optimade optimade-api optimade-specification

optimade-mpds-nlp's Introduction

MPDS-based NLP for Optimade

NPM version NPM downloads GitHub issues

This is the early version of the JavaScript utilities for parsing an arbitrary string (ideally, in the natural language) into the Optimade filter query. An intermediate layer is the MPDS search query object notation, see the MPDS platform and its API documentation.

To see how it works, try to paste an example string

cubic, disordered perovskites with actinides and chlorine

into the main search field of the MPDS, and it will be correctly recognized and assigned to the following classes:

{
    "elements": "Cl",
    "classes": "disordered, perovskite, actinoid",
    "lattices": "cubic"
}

Used by:

Installation

npm i optimade-mpds-nlp --save

Usage

The code is fully isomorphic and standalone. The following MPDS categories (out of 15) can be currently detected in a free-form text:

The algorithm is mostly heuristic, which means it may or may not work for your particular keywords.

One has to import the only class from the module, instantiate, and use the guess method:

const converter = NLP();
const mpds_query = converter.guess(input_str);

The following Optimade query keywords can be currently obtained calling converter.to_optimade(mpds_query):

  • chemical_formula_anonymous
  • chemical_formula_reduced
  • elements HAS ALL "..."
  • nelements=...

There might be some other MPDS-specific Optimade keywords with the _mpds_ prefix implemented, being not the part of the Optimade standard though.

License

MIT © Tilde Materials Informatics and Materials Platform for Data Science

optimade-mpds-nlp's People

Contributors

blokhin avatar

Stargazers

 avatar  avatar  avatar

optimade-mpds-nlp'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.