Natural Language Query for .NET C# semantic search for databases


features natural language interface c# library

  • pure C# NLP NER library: supports all .NET target platforms
  • fast in-memory rule-based recognizer engine: can parse natural language query and match entities in milliseconds
  • optimized for large entity name dictionaries: works fine for 500,000+ unique values.
  • supports synonyms for better recognition results and ontology matching.
  • handles relative date phrases like "yesterday", "last week", "last month", "last year" and ranges ("before", "after")
  • equalities: between, more than, less than, expressions like "age>18"
  • helps users to form a query with autocomplete suggestions

examples typical usage scenarios

  • NliDataFilter: natural language interface for SQL filter
    • illustrates how to configure recognizers by data table schema
    • scoring function for best matches
    • generates SQL WHERE by recognition results
    • useful for adding user-friendly filter to the data lists or grids
  • NliPivotTable: search-based OLAP queries to PivotData in-memory data cube
    • illustrates how to configure recognizers by PivotData object
    • scoring function for best pivot table configuration
    • generates PivotData SliceQuery by recognition results
    • result is a PivotTable object that can be used for rendering crosstab report or pivot chart

download and pricing

quick purchase process

  • 1 Choose a package
  • 2 Pay online 2Checkout.com is a worldwide leader in online payment services
  • 3 Download the package

NReco NLQuery is a simple way to add search-based interface to your .NET business application. It was specially designed for matching business entities from structured data sources (database, OLAP cube, tabular data).

Applications: smart keyword-based filters for lists/grids, global semantic search by whole database (quick lookup), search-driven ad-hoc reporting and analytics (reports by search), messenger (IM) bots.

how to use

  1. Download the package and add reference to the NReco.NLQuery.dll assembly
  2. var queryTokens = new Tokenizer().Parse("John closed tasks");
    var recognizer = new NamedEntityRecognizer( 
    	new StringKeyMatcher("person", 
    		new[] {"John Smith", "John Doe", "Bart Simpson"},
    		true) );
    var nerResults = recognizer.Recognize(queryTokens);
    // analyze nerResults matches to find best combination
    // build and execute formal query 
  3. Next steps:
Have a question? Feel free to ask.

frequently asked questions

Traditional NL statistical parsers (like Apache OpenNLP) are good in processing unstructured natural language text but not so good when used for natural language interfaces (NLI). Main reasons are:
  • in most cases natural language interfaces don't receive complete (and correct) natural language sentences: good examples are google search queries. In most cases NLI input is a set of interconnected keywords and phrases; words meaning may be very specific to the context of the search query.
  • statistical parsers require training on a massive corpus of questions (queries) and desired output, and manual creation of such corpus for each database is unacceptable expensive for most applications - or even not possible at all, if database content is unique for each user (like in SaaS applications).
  • when a database is changed, results may become unreliable without additional re-training. It's hard to incorporate special hints and formal expressions (like field conditions) that are very desirable for NLI in business applications.

NLQuery was specially designed for processing natural language queries in the semantic context of concrete database or dataset. It aims to be database-independent NLI that doesn't require any training; internally NLQuery mixes formal rule-based approach for named entity recognition by ontology information (database schema, unique values) with probability approach for getting the best formal result that matches a search query.

what's new

(coming soon) Roadmap for v1.0beta2:
  • ConditionMatcher for handling phrases like "age > 18" or "age less than 30"
  • Generic query suggestions and ranking function implementation
2016 Apr 28 Added advanced example NliDataFilter: generates SQL where condition by search query.
2016 Apr 19 v.1.0beta1 available for download:
  • Implements tokenizer and basic matchers: StringKeyMatcher, NumberKeyMatcher, DateMatcher, RelativeDateMatcher.
  • Trial package includes simple example that recognizes films by MovieLens dataset.

more components

  • PivotData Toolkit for .NET

    .NET components for manipulating multidimensional dataset (in-memory data cube) without OLAP server, aggregating huge datasets, calculating data for pivot table / chart reports, ASP.NET pivot table builder control.

  • Recommendation Engine

    Fast collaborative filtering engine that takes users' behaviour and from that tries to find items users might like.