Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 2.56 KB

README.md

File metadata and controls

70 lines (46 loc) · 2.56 KB

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