Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have to run a project involving NAO robot programmed in python. What I have to do is to assign some knowledge on what is shown to NAO.
For example:
A person shows NAO a picture (drawn by hand on a whiteboard)
The person says "House" (let's say the person draws a house)
NAO now knows that the picture shown represents a house
The problem I have encountered is in the speech recognition module. Only words in a certain vocabulary could be recognized. But in my project setting, a person should draw on a whiteboard and say to NAO what is drawn there. So, means I cannot know what the person is going to draw and I cannot set the vocabulary in advance.
My starting point is this tutorial here. As you can see by reading the tutorial, can be recognized only certain words belonging to the vocabulary, like in this line of code:
wordList=["yes","no","hello Nao","goodbye Nao"]
asr.setWordListAsVocabulary(wordList)
During the recognition, an event called WordRecognized is raised. It has this structure:
Event: "WordRecognized"
callback(std::string eventName, AL::ALValue value, std::string subscriberIdentifier)
It is raised when one of the specified words with ALSpeechRecognitionProxy::setWordListAsVocabulary() has been recognized. When no word is currently recognized, this value is reinitialized.
So I suppose the key of my answer is here, but I need an help.
How could I solve this problem? Is there any better documentation I can refer to?
Thanks in advance!
The problem is that NAO speech recognition module is proprietary and I highly doubt you can do such things with it.
However, if you consider ROS platform and open source engine like CMUSphinx you can definitely do what you want. It's easy to include placeholder word to a grammar which will be matched against an unknown word and later be placed in the dictionary.
This is a highly complicated research question to learn the vocabulary by voice interaction, but it was done before. As an example you can read this publication
Combined systems for automatic phonetic transcription of proper nouns
A. Laurent, T. Merlin , S. Meignier, Y. Esteve, P. Deleglise
http://www.lrec-conf.org/proceedings/lrec2008/pdf/455_paper.pdf
The only thing is that you want to work with the recognizer on the very low level.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I generate text via transformer models and I am looking for a way of measuring the grammatical text-quality.
Like the text: "Today is a good day. I slept well and got up good in the morning."
should be rated higher than: "Yesterday I went into bed and. got Breakfast son."
Are there any models, which can do this job which I didnt find before, or is there any other way of measuring the quality of the grammatical output of the text?
What I found out was, that spacy has the option to show whether a text has a grammatical error, but what I am more interested in is a score which included the length of the text and the amount of error it has.
Also I looked into NLTK readability, but this aims at how well the text can be understood, which depends on more than the grammar only.
Thank you!
So I found what I was looking for:
In this paper the researchers tested different measures for their ability on checking grammar mistakes for text without references (what the GLEU-Score can be used for). They also tested the python-language-tool which is also used for spell checking in open-office. This tool is able to measure the amount of grammar mistakes in a text. For my purpose, I will just divide the amount of error through the amount of words in the text, which gives me an error metric.
Maybe this helps someone, who has the same issue. Here the example code, based on pypi:
import language_tool_python
tool = language_tool_python.LanguageTool('en-US')
text = "this is a test tsentence, to check if all erors are found"
matches = tool.check(text)
len(matches)
>>>3
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am currently working on an AI Agent that will be able to identify both the start state and the goal state of the famous old plumbing game found here
https://i.imgur.com/o1kFcT3.png
http://html5.gamedistribution.com/a73b1e79af45414a88ce3fa091307084/
The idea is to allow the water to flow from the start point to the exit point, the AI only rotate the tiles, and not all tiles and populated, The problem that this will be an unguided search.
I am really lost and help will be appreciated.
What I thought about is that I should assign a number for each tile and rotation and make a series of allowed sequence ? but I am not sure if that's the best way to go or not, because they sequence will be 10! which is huge.
The other approach can be assigning the holes of each pipe as North,West,South,East and check if the tiles link ?
The solution should be flexible and tiles might shuffle/Change so assigning the goal state manually won't work.
Any idea will be greatly appreciated.
In the original plumbing game, the player can click on a tile and change it's direction clockwise. This allows to generate a path for the water flow from start to the goal. The amount of possible actions is indeed exponential and can't calculated on a normal computer. To overcome the problem, macro actions are the perfect choice. A macro action is a virtual action not available in the original game. It's a self-invented abstract game on top of the original one. A possible macro action would build a path to a waypoint in the middle, and a second macro action generates a path from the middle to the end. The newly created macro actions can solved independently by a hierarchical planner and the resulting low level actions are executed in the original game.
A possible programming language to realize macro actions is the game description language, PDDL or a formal grammar. If the concept was understood, even normal Python code can be used to realize the abstract game. A possible macro action results into a state, similar to what is called in the deeplearning community a reward. This allows to subdivide the problem into smaller chunks.
For the plumbing game, no ready-to-run solver is described in the literature, but the sokoban game was discussed before: Zhou, Neng-Fa, and Agostino Dovier. "A tabled Prolog program for solving Sokoban." Fundamenta Informaticae 124.4 (2013): 561-575.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm trying to create a machine learning algorithm, for address classification or similar address classification, for rural(Villages) areas. I have a historical data, which includes list of Addresses (Independent Variable), Village Name (Independent Variable) Pin-Codes (Independent Variable), Customer Mobile Number and Route No (Dependent Variable). Route No is for delivery cart, which will help them to cover maximum number of delivery destination in that area.
Challenges -
"Address" can be miss spelled.
"Villages Name" can be null.
"Pin-codes" can be wrong.
Good Thing -
Not all the independent variables can be wrong/null at the same time.
Now the point of creating this algorithm is for selecting the best Route Number, on the basis of "Address", "Villages", "Pin-Codes", and Historical Data(In which we have manually selected the Route for delivery carts).
I'm the beginner, i'm confused how to do this which process is to use.
Tasked I have done.
Address cleaning - Removed short words, Removed Big Words, Removed Stop Words.
Now trying to do it with word vector, but i'm not able to do that.
for this first you'll have to build a dataset first - consisting the names of as many villages as you can! because many villages have similar names so identifying a typo is pretty difficult and risky! there is a difference of one or two letters. So, bigger dataset is better.
Then, try to use TF-IDF on the combination of village name and PIN code (this link may be helpful for Indian data) or you can go for fuzzy logic.
Hope it helps! Happy coding!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Given words like "romantic" or "underground", I'd like to use python to go through a list of text data and retrieve entries that contain those words and associated words such as "girlfriend" or "hole-in-the-wall".
It's been suggested that I work with NLTK to do this, but I have no idea where to start and I know nothing about language processing or linguistics. Any pointers would be much appreciated.
You haven't given us much to go on. But let's assume you have a paragraph of text. Here's one I just stole from a Yelp review:
What a beautiful train station in the heart of New York City. I've grown up seeing memorable images of GCT on newspapers, in movies, and in magazines, so I was well aware of what the interior of the station looked like. However, it's still a gem. To stand in the centre of the main hall during rush hour is an interesting experience- commuters streaming vigorously around you, sunlight beaming in through the massive windows, announcements booming on the PA system. It's a true NY experience.
Okay, there are a bunch of words there. What kind of words do you want? Adjectives? Adverbs? NLTK will help you "tag" the words, so you can find all the ad-words: "beautiful", "memorable", "interesting", "massive", "true".
Now, what are you going to do with them? Maybe you can throw in some verbs and nouns, "beaming" sounds pretty good. But "announcements" isn't so interesting.
Regardless, you can build an associations database. This ad-word appears in a paragraph with these other words.
Maybe you can count the frequency of each word, over your total corpus. Maybe "restaurant" appears a lot, but "pesthole" is relatively rare. So you can filter that way? (Only keep "interesting" words.)
Or maybe you go the other way, and extract synonyms: if "romantic" and "girlfriend" appear together a lot, then call them "correlated words" and use them as part of your search engine?
We don't know what you're trying to accomplish, so it's hard to make suggestions. But yes, NLTK can help you select certain subgroups of words, IF that's actually relevant.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm very new at Python but really interested in making a code that could simulate guitar strings. How would I go about doing this? Or at least how would I begin to do this? Any help is appreciated!
Thank you!
EDIT:
I would like to see the sound waves when playing different strings, notes, etc.
I am also interested in the sound waves when two different strings are being played, and how that changes when they are dissonant and consonant notes.
Another thing I'm interested in is how sometimes strings vibrate when they are not being plucked (resonance).
Any help is appreciated, thank you!!!
This is really a question of sound synthesis, and there's no simple answer. There are a whole bunch of possible approaches--it's an entire field of study. Physical Audio Signal Processing by J.O. Smith is a good starting point, as is The Theory and Technique of Electronic Music by Miller Puckette. For guitar, you might particularly be interested in the Karpus-Strong method. Perhaps you should search for a Python implementation of it. It's a common project for students in music technology programs; I'm sure there are many.