quepy | python framework to transform natural language questions | SQL Database library
kandi X-RAY | quepy Summary
kandi X-RAY | quepy Summary
A python framework to transform natural language questions to queries in a database query language.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Takes a string of text and returns a dictionary of tokens
- Run nltkagger
- Return morphy tag
- Ensures that the given string is valid
- Generate code for given expression
- Convert characters to unicode
- Escape special characters
- Convert an expression into a graph representation
- Count the probability of a string
- Calculate a predicate sum from a string
- Count tokens from a string
- Computes Lemmas from a string
quepy Key Features
quepy Examples and Code Snippets
training_data.append({"class":"greeting", "sentence":"how are you?"})
training_data.append({"class":"greeting", "sentence":"how is your day?"})
training_data.append({"class":"greeting", "sentence":"good day"})
training_data.append({"class"
Community Discussions
Trending Discussions on quepy
QUESTION
I'm working on a project where I need to extract "inputs" and "query intent" from text.
For example "What is the status of asset X26TH?"
In this case the main issue is to extract asset id which is X26TH, but how can I make my code understand that it's an id?
The other thing is to understand the query intent which is asset status. I found a good library for this called quepy, but it's meant for linux and I couldn't set it up on windows.
Please help me with the techniques and libraries.
...ANSWER
Answered 2017-Jul-04 at 10:32So you have two problems, ID extraction and intent detection.
ID ExtractionIf your IDs follow a regular pattern and definitely don't look like English, you can catch them with a regex - if that's possible, that's great since it's very easy to do. If you have a fixed list of product IDs, just check to see if any of them are in the input. If neither of those work then you'll have to get more sophisticated.
Can you get your users to remember a little syntax? If you can request that they write things with a prefix like id:X26TH
or similar that would make your job easier. You may find the way the plumber in Plan9 works informative.
If you need to work with whatever the users throw at you, you should look into using a sequence labeller or Named Entity Recognition (NER) system to get IDs. CRFs are probably a good fit for this task; here's a good technial introduction, and the New York Times also used one with success. Besides being trickier to set up a downside of this is that it will require training data, but there's really no way to avoid that.
Intent DetectionThis is usually modelled as a text classification problem. You can find an overview of how to do that here. Here's some training examples from the article:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install quepy
You can use quepy like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page