Natural Language Query for .NET search-like interface in C#
features natural language interface c# library
- pure C# rule-based NLP NER library for .NET
- fast and efficient rule-based named entity recognition engine: parses natural language query, performs matching and generates top-combinations in milliseconds.
- implements basic set of matchers for handling typical search queries
- handles relative date phrases like "yesterday", "last week", "last month", "last year", conditions "between", "more than", "less than", "age>18", ranges like "before", "after".
- supports matching in external indexes (like Lucene).
- synonyms for better recognition results and ontology matching.
- easy-to-use: includes a component that automatically configures recognizer by data table description.
- helps users to form a query with autocomplete suggestions
- OPEN SOURCE and FREE for usage in non-SaaS apps that have only one single-server production deployment
download and pricing
NReco.NLQuery Source Code & Examples | View on GitHub |
NLQuery Commercial License
A commercial license that removes free-usage limitations (perpetual), 1 year of email support. |
$499 - Order Now |
NReco.NLQuery provides simple way to add search-based interface into your .NET business application.
It was specially designed for matching business entities in context of structured data (tabular data or database, OLAP cube, text indexes).
Library is useful for: keyword-based filters for lists/grids, custom semantic search by database(s), search-driven analytics (reports by search), parse incoming messages by bots.
Library is useful for: keyword-based filters for lists/grids, custom semantic search by database(s), search-driven analytics (reports by search), parse incoming messages by bots.
how to use
- Install NReco.NLQuery nuget package
- Configure a recognition engine (C#):
var tblMatchBuilder = new TableMatcherBuilder(); tblMatchBuilder.Add(tasksTableSchema); var recognizer = new Recognizer(tblMatchBuilder.Build());
- Parse user's search query:
var tokens = new Tokenizer().Parse("John closed tasks"); var searchQuery = new TokenSequence(tokens.ToArray()); recognizer.Recognize(searchQuery, matchesCombinationHandler);
- In
matchesCombinationHandler
choose best recognition with your scoring function and translate matches to formal query like SQL. - Next steps:
- Try & review NLQuery examples
- Explore NLQuery source code & tests
online demo & examples
- NLQuery Demo: Search-based Filter for Data List
- 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
- source code for this demo: NliDataFilter
- NLQuery Example: Search-Driven Reports Builder
- 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
- source code for this demo: NliPivotTable
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:
NLQuery was specially designed for processing natural language queries in the context of tabular data (like database). 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.
- in most cases natural language interfaces don't receive complete (and correct) natural language sentences: good examples are google search queries. NLI input is actually 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 recognition, and manual creation of such corpus for each database usually is unacceptable for number of reasons; this might be not possible at all if database content is unique for each user (for instance, 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 (say, field conditions) that are very desirable for NLI in the business applications.
NLQuery was specially designed for processing natural language queries in the context of tabular data (like database). 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.
NLQuery library (NReco.NLQuery.dll) can be used for
FREE in non-SaaS apps that have only one single-server production deployment (free license text).
A commercial license is required for multiple deployments, redistribution as part of your product, or usage in SaaS app.
A commercial license is required for multiple deployments, redistribution as part of your product, or usage in SaaS app.
what's new
2024 Aug 20 |
v.1.2.1 release:
|
2024 Aug 05 |
v.1.2.0 release:
|
2022 Aug 29 |
v.1.1.1 release:
|
2019 Oct 23 |
v.1.1 release:
|
2018 Mar 19 |
v.1.0 release:
|
2016 Sep 02 | Added advanced example NliDataFilter: generates SQL where condition by search query. |
2016 Apr 28 | Added advanced example NliDataFilter: generates SQL where condition by search query. |
2016 Apr 19 |
v.1.0-beta1 (first public version):
|
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 tables / charts, web pivot table control for ASP.NET MVC/Blazor.
-
Recommendation Engine
Fast collaborative filtering engine that takes users' behaviour and from that tries to find items users might like.