You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Mayank Lahiri (JIRA)" <ji...@apache.org> on 2010/08/07 01:30:16 UTC

[jira] Commented: (HIVE-1518) context_ngrams() UDAF for estimating top-k contextual n-grams

    [ https://issues.apache.org/jira/browse/HIVE-1518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896187#action_12896187 ] 

Mayank Lahiri commented on HIVE-1518:
-------------------------------------

Note that this generalizes ngrams(), but is less efficient than ngrams(). For example,

SELECT ngrams(sentences(tweets), 2, 100) 

is equivalent to:

SELECT context_ngrams(sentences(tweets), array(null, null), 100)

> context_ngrams() UDAF for estimating top-k contextual n-grams
> -------------------------------------------------------------
>
>                 Key: HIVE-1518
>                 URL: https://issues.apache.org/jira/browse/HIVE-1518
>             Project: Hadoop Hive
>          Issue Type: New Feature
>          Components: Query Processor
>    Affects Versions: 0.6.0
>            Reporter: Mayank Lahiri
>            Assignee: Mayank Lahiri
>             Fix For: 0.6.0
>
>
> Create a new context_ngrams() function that generalizes the ngrams() UDAF to allow the user to specify context around n-grams. The analogy is "fill-in-the-blanks", and is best illustrated with an example:
> SELECT context_ngrams(sentences(tweets), array("i", "love", null), 300) FROM twitter;
> will estimate the top-300 words that follow the phrase "i love" in a database of tweets. The position of the null(s) specifies where to generate the n-gram from, and can be placed anywhere. For example:
> SELECT context_ngrams(sentences(tweets), array("i", "love", null, "but", "hate", null), 300) FROM twitter;
> will estimate the top-300 word-pairs that fill in the blanks specified by null.
> POSSIBLE USES:
> 1. Pre-computing search lookaheads
> 2. Sentiment analysis for products or entities -- e.g., querying with context = array("twitter", "is", null)
> 3. Navigation path analysis in URL databases

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.