Skip to content

Free-form search terms translation into the Optimade query language

License

Notifications You must be signed in to change notification settings

mpds-io/optimade-mpds-nlp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Free-form search terms translation into the Optimade query language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published