Return-Path: Delivered-To: apmail-hadoop-hive-dev-archive@minotaur.apache.org Received: (qmail 29163 invoked from network); 6 Jul 2010 20:55:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Jul 2010 20:55:44 -0000 Received: (qmail 13214 invoked by uid 500); 6 Jul 2010 20:55:44 -0000 Delivered-To: apmail-hadoop-hive-dev-archive@hadoop.apache.org Received: (qmail 13106 invoked by uid 500); 6 Jul 2010 20:55:44 -0000 Mailing-List: contact hive-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hadoop.apache.org Delivered-To: mailing list hive-dev@hadoop.apache.org Received: (qmail 13098 invoked by uid 99); 6 Jul 2010 20:55:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 20:55:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 20:55:41 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o66KloD5021575 for ; Tue, 6 Jul 2010 20:47:50 GMT Message-ID: <2544455.222911278449270381.JavaMail.jira@thor> Date: Tue, 6 Jul 2010 16:47:50 -0400 (EDT) From: "Mayank Lahiri (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Commented: (HIVE-1438) sentences() UDF for natural language tokenization In-Reply-To: <8563051.64881277495690421.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HIVE-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885679#action_12885679 ] Mayank Lahiri commented on HIVE-1438: ------------------------------------- Patch available for code review. Implements the UDF as described. > sentences() UDF for natural language tokenization > ------------------------------------------------- > > Key: HIVE-1438 > URL: https://issues.apache.org/jira/browse/HIVE-1438 > Project: Hadoop Hive > Issue Type: New Feature > Components: Query Processor > Affects Versions: 0.7.0 > Reporter: Mayank Lahiri > Assignee: Mayank Lahiri > Fix For: 0.7.0 > > Attachments: HIVE-1438.1.patch > > > Create a generic UDF that tokenizes free-form natural language text into sentences and words for more advanced processing, while stripping unnecessary punctuation and being fully international-aware. Fortunately, most of this functionality is already built into Java in the form of the i8n BreakIterator class, so this UDF will just connect it to Hive. For example: > > SELECT sentences("Hello there! This is a UDF.") FROM somedata LIMIT 1; > [ ["Hello", "there"], ["This", "is", "a", "UDF"] ] > or > > SELECT sentences("Je m'apelle hive!!!", "fr") FROM somedata LIMIT 1; > [["Je","m'apelle","hive"]] > Notice how punctuation is maintained only where appropriate. Breaking at sentences (and thus the nested array return type) is important for tasks like counting the frequency of n-grams in text, which should not cross sentence boundaries. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.