Nlp to Classify/Label The Content of a Sentence (Ruby Binding Necesarry)

NLP classify sentences/paragraph as funny

There is research on this, it's called Computational Humor. It's an interdisciplinary area that takes elements from computational linguistics, psycholinguistics, artificial intelligence, machine learning etc. They are trying to find out what it is that makes stories or jokes funny (e.g. the unexpected connection, or using a taboo topic in a surprising way etc) and apply it to text (either to generate a funny story or to measure the 'funniness' of text).

There are books and articles about it (e.g. by Graeme Ritchie).

Natural Language Processing in Ruby

There are some things at Ruby Linguistics and some links therefrom, though it doesn't seem anywhere close to what NLTK is for Python, yet.

how to do classification on the result of stanford-core nlp

Actually the right answer is that, YES stanford classifier is a supervised algorithm,

so if anyone want to do classification on the result of corenlp, it needs some coding , like for example I firstly did the corenlp for very negative ones, then I made the document as the text for very negative text,

then I made another document for very positive, and so on,

finally I had for example two document of the result of corenlp for positive and negative,

Then I used those document for the stanford classifier

hope helps somebody which is new to this area

NLP - identifying which adjective describes which noun in a sentence

You can use Stanford dependency parser, also this relevant paper. You can check their online tool as well. For example, for your sentence, you can get the following from Stanford parser.

Your query

The product itself is good however this company has a terrible service.

Tagging

The/DT product/NN itself/PRP is/VBZ good/JJ however/RB this/DT company/NN has/VBZ a/DT terrible/JJ service/NN ./.

Parse

(ROOT
(S
(NP (DT The) (NN product))
(ADVP (PRP itself))
(VP (VBZ is)
(ADJP (JJ good))
(SBAR
(WHADVP (RB however))
(S
(NP (DT this) (NN company))
(VP (VBZ has)
(NP (DT a) (JJ terrible) (NN service))))))
(. .)))

Universal dependencies

det(product-2, The-1)
nsubj(good-5, product-2)
advmod(good-5, itself-3)
cop(good-5, is-4)
root(ROOT-0, good-5)
advmod(has-9, however-6)
det(company-8, this-7)
nsubj(has-9, company-8)
dep(good-5, has-9)
det(service-12, a-10)
amod(service-12, terrible-11)
dobj(has-9, service-12)

What grammar based parser-generator tools exist for ruby?

Have you looked at rex and racc, the gem versions of lex and yacc?

How do I make WPF data bindings refactor safe?

You could use a lambda expression to express the property name, rather than using the name directly :

    protected static string GetPropertyName<TSource, TResult>(Expression<Func<TSource, TResult>> expression)
{
if (expression.NodeType == ExpressionType.Lambda && expression.Body.NodeType == ExpressionType.MemberAccess)
{
PropertyInfo prop = (expression.Body as MemberExpression).Member as PropertyInfo;
if (prop != null)
{
return prop.Name;
}
}
throw new ArgumentException("expression", "Not a property expression");
}

You would use it like that :

...
DisplayMember = new Binding(GetPropertyName((MyDataObject o) => o.FooProperty))
...

OK, it's a bit verbose... If you want something shorter, you could also create a helper method :

public Binding CreateBinding<TSource, TResult>(Expression<Func<TSource, TResult>> expression)
{
return new Binding(GetPropertyName(expression))
}

...
DisplayMember = CreateBinding((MyDataObject o) => o.FooProperty)
...

That way, the refactoring should work fine if you rename the property (except in the XAML of course...)



Related Topics



Leave a reply



Submit