NLP: Extract shape names and shape dimensions
I am an NLP beginner. I am working on a task where I have to process a text to draw shapes.
I did some research and found that tokensregex could be a good fit.
For example
Text : Could you please draw an Isosceles triangle with an altitude of 150 and a base of 100.
In here, my approach is to write tokensregex rule to extract shape name and dimensions. Once i get these two data, I will draw the extracted shape with the given dimensions.
Is my choice of using tokensregex correct?
Or is there any other way to do it smartly?
c# nlp
add a comment |
I am an NLP beginner. I am working on a task where I have to process a text to draw shapes.
I did some research and found that tokensregex could be a good fit.
For example
Text : Could you please draw an Isosceles triangle with an altitude of 150 and a base of 100.
In here, my approach is to write tokensregex rule to extract shape name and dimensions. Once i get these two data, I will draw the extracted shape with the given dimensions.
Is my choice of using tokensregex correct?
Or is there any other way to do it smartly?
c# nlp
add a comment |
I am an NLP beginner. I am working on a task where I have to process a text to draw shapes.
I did some research and found that tokensregex could be a good fit.
For example
Text : Could you please draw an Isosceles triangle with an altitude of 150 and a base of 100.
In here, my approach is to write tokensregex rule to extract shape name and dimensions. Once i get these two data, I will draw the extracted shape with the given dimensions.
Is my choice of using tokensregex correct?
Or is there any other way to do it smartly?
c# nlp
I am an NLP beginner. I am working on a task where I have to process a text to draw shapes.
I did some research and found that tokensregex could be a good fit.
For example
Text : Could you please draw an Isosceles triangle with an altitude of 150 and a base of 100.
In here, my approach is to write tokensregex rule to extract shape name and dimensions. Once i get these two data, I will draw the extracted shape with the given dimensions.
Is my choice of using tokensregex correct?
Or is there any other way to do it smartly?
c# nlp
c# nlp
asked Nov 26 '18 at 5:36
MARKAND BhattMARKAND Bhatt
83742354
83742354
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Given the well defined boundaries of your problem, Tokensregex could be the right way to go. You might spend some time maturing it. But it should be the preferred way. But before you finalise your approach I suggest you pitch it against some deep parsing technique. Here is what you could get that you might be able to combine with some dictionary of known shapes and write extraction logic.
(ROOT
(SQ (MD Could)
(NP (PRP you))
(VP (VB please)
(VP (VB draw)
(NP (DT an) (NNP Isosceles) (NN triangle))
(PP (IN with)
(NP
(NP
(NP (DT an) (NN altitude))
(PP (IN of)
(NP (CD 150))))
(CC and)
(NP
(NP (DT a) (NN base))
(PP (IN of)
(NP (CD 100))))))))
(. .)))
Here, you are getting readymade chunks of altitude - 150 and base - 100. See if this helps.
add a comment |
There is no right way to do what you are asking. If all your sentences are as on the example, then the rule-based approach with dependency parsing seems like a solution where rules identify attributes and values and dependency parsing identifies relations between them.
More formally, semantic parsing should help in this case
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53475256%2fnlp-extract-shape-names-and-shape-dimensions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Given the well defined boundaries of your problem, Tokensregex could be the right way to go. You might spend some time maturing it. But it should be the preferred way. But before you finalise your approach I suggest you pitch it against some deep parsing technique. Here is what you could get that you might be able to combine with some dictionary of known shapes and write extraction logic.
(ROOT
(SQ (MD Could)
(NP (PRP you))
(VP (VB please)
(VP (VB draw)
(NP (DT an) (NNP Isosceles) (NN triangle))
(PP (IN with)
(NP
(NP
(NP (DT an) (NN altitude))
(PP (IN of)
(NP (CD 150))))
(CC and)
(NP
(NP (DT a) (NN base))
(PP (IN of)
(NP (CD 100))))))))
(. .)))
Here, you are getting readymade chunks of altitude - 150 and base - 100. See if this helps.
add a comment |
Given the well defined boundaries of your problem, Tokensregex could be the right way to go. You might spend some time maturing it. But it should be the preferred way. But before you finalise your approach I suggest you pitch it against some deep parsing technique. Here is what you could get that you might be able to combine with some dictionary of known shapes and write extraction logic.
(ROOT
(SQ (MD Could)
(NP (PRP you))
(VP (VB please)
(VP (VB draw)
(NP (DT an) (NNP Isosceles) (NN triangle))
(PP (IN with)
(NP
(NP
(NP (DT an) (NN altitude))
(PP (IN of)
(NP (CD 150))))
(CC and)
(NP
(NP (DT a) (NN base))
(PP (IN of)
(NP (CD 100))))))))
(. .)))
Here, you are getting readymade chunks of altitude - 150 and base - 100. See if this helps.
add a comment |
Given the well defined boundaries of your problem, Tokensregex could be the right way to go. You might spend some time maturing it. But it should be the preferred way. But before you finalise your approach I suggest you pitch it against some deep parsing technique. Here is what you could get that you might be able to combine with some dictionary of known shapes and write extraction logic.
(ROOT
(SQ (MD Could)
(NP (PRP you))
(VP (VB please)
(VP (VB draw)
(NP (DT an) (NNP Isosceles) (NN triangle))
(PP (IN with)
(NP
(NP
(NP (DT an) (NN altitude))
(PP (IN of)
(NP (CD 150))))
(CC and)
(NP
(NP (DT a) (NN base))
(PP (IN of)
(NP (CD 100))))))))
(. .)))
Here, you are getting readymade chunks of altitude - 150 and base - 100. See if this helps.
Given the well defined boundaries of your problem, Tokensregex could be the right way to go. You might spend some time maturing it. But it should be the preferred way. But before you finalise your approach I suggest you pitch it against some deep parsing technique. Here is what you could get that you might be able to combine with some dictionary of known shapes and write extraction logic.
(ROOT
(SQ (MD Could)
(NP (PRP you))
(VP (VB please)
(VP (VB draw)
(NP (DT an) (NNP Isosceles) (NN triangle))
(PP (IN with)
(NP
(NP
(NP (DT an) (NN altitude))
(PP (IN of)
(NP (CD 150))))
(CC and)
(NP
(NP (DT a) (NN base))
(PP (IN of)
(NP (CD 100))))))))
(. .)))
Here, you are getting readymade chunks of altitude - 150 and base - 100. See if this helps.
answered Nov 26 '18 at 7:48
rishirishi
1,15831841
1,15831841
add a comment |
add a comment |
There is no right way to do what you are asking. If all your sentences are as on the example, then the rule-based approach with dependency parsing seems like a solution where rules identify attributes and values and dependency parsing identifies relations between them.
More formally, semantic parsing should help in this case
add a comment |
There is no right way to do what you are asking. If all your sentences are as on the example, then the rule-based approach with dependency parsing seems like a solution where rules identify attributes and values and dependency parsing identifies relations between them.
More formally, semantic parsing should help in this case
add a comment |
There is no right way to do what you are asking. If all your sentences are as on the example, then the rule-based approach with dependency parsing seems like a solution where rules identify attributes and values and dependency parsing identifies relations between them.
More formally, semantic parsing should help in this case
There is no right way to do what you are asking. If all your sentences are as on the example, then the rule-based approach with dependency parsing seems like a solution where rules identify attributes and values and dependency parsing identifies relations between them.
More formally, semantic parsing should help in this case
answered Nov 26 '18 at 7:51
comcom
1,17131532
1,17131532
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53475256%2fnlp-extract-shape-names-and-shape-dimensions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown