Skip to content

Commit

Permalink
Release 1.3.7
Browse files Browse the repository at this point in the history
added new examples for language name and text classification
  • Loading branch information
gurudevrao committed Sep 10, 2018
1 parent 0c9cea1 commit 9074b10
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/language_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
response = ai.language("lorem ipsum")
print(response)

response = ai.language_name("lorem ipsum")
print(response)

response = ai.language("matter tells space how to curve and space tells matter how to move")
print(response)

Expand Down
40 changes: 40 additions & 0 deletions examples/text_classification.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python

from __future__ import division, print_function, absolute_import

#***************************** TEXT CLASSIFICATION ************************************/
#
# This example shows how to query Gurunudi to identify language of a text
#
#***************************** TEXT CLASSIFICATION ************************************/

from gurunudi import AI,lang

#AI is the wrapper class to call Gurunudi AI API
ai = AI()

response = ai.classify("John ate an apple.","tense")
print(response)

response = ai.classify("Where are you going?.","mood")
print(response)

response = ai.classify("Einstein discovered relativity.","mood")
print(response)

response = ai.classify("You have won 1 million dollars","email")
print(response)

response = ai.classify("India wins the ICC world cup","news")
print(response)

response = ai.classify("that movie was really bad","sentiment")
print(response)


#For the latest updated list of languages supported by Gurunudi for text classification visit https://gurulaghu.com/languages/





0 comments on commit 9074b10

Please sign in to comment.