Built-In Machine Learning in the Wolfram Language

© Wolfram Research, Inc.

The Wolfram Language™ Makes It So Easy To ...

Recognize Famous People from their Photos

photos = {,,,,,};
Classify["NotablePerson",photos]

Identify the Object in an Image

testImages = {,,,};
ImageIdentify[testImages]

Detect the Language from Text

LanguageIdentify[{"hallo en welkom","नमस्ते और आपका स्वागत हैै","أهلا ومرحبا", "নমস্কার এবং স্বাগত","హలో మరియు స్వాగతం","你好，歡迎光臨","Bonjour et bienvenue","こんにちは、いらっしゃい","ಹಲೋ ಮತ್ತು ಸ್ವಾಗತ","hujambo na karibu","привіт і ласкаво просимо","خوش اور استقبال"}]

Pre-trained Classifiers

A number of pre-trained classifiers for specific tasks in computer vision, natural language processing applications, etc. These classifiers have been trained on large amounts of data, and their parameters have been tuned for optimal performance.

Two ways to access them:

Using Classify with named classifiers: “Language”, “Sentiment”, “Spam”, “FacebookTopic”, “NotablePerson”, etc.

Invoking built-in functions: ImageIdentify, LanguageIdentify, TextRecognize, TextCases, TextStructure

Classify with a Named Classifier

Language

Classify["Language", {"the house is blue", "la maison est bleue", "la casa es azul", "das Haus ist blau", "房子是蓝色的", "المنزل باللون الأزرق", "будинок синій"}]

Sentiment

Classify["Sentiment",{"I love this movie", "I am so sad", "My phone broke again"}]

Spam

Classify["Spam",{"SALE! Buy more", "Call mom now", "Send money now"}]

FacebookTopic

Classify["FacebookTopic", {"I bought a new computer", "happy birthday!", "these shoes looks nice"}]

ProgrammingLanguage

Classify["ProgrammingLanguage",{"my $filename = 'check.txt';","document.write('Hello, world!');","on helloWorld()","echo 'Hello World'","List[a,b,c]"}]

NotablePerson

test ={, };
who =Classify["NotablePerson",test,{"TopProbabilities",3}];
Row[{test[[#]],Column[who[[#]]]}]& /@ {1,2}

Dedicated Functions: Computer Vision

ImageIdentify

ImageIdentify[]

ImageIdentify[]

ImageInstanceQ

ImageInstanceQ[,"cat"]

FindFaces

i=;
faces=FindFaces[i]
ImageTrim[i,#]&/@faces

HighlightImage[i,{"Boundary",Red,Rectangle@@@FindFaces[#]&}]

TextRecognize

TextRecognize[]

Dedicated Functions: Natural Language Processing

LanguageIdentify

LanguageIdentify[{"the house is blue", "la maison est bleue", "la casa es azul", "das Haus ist blau", "房子是蓝色的", "المنزل باللون الأزرق", "будинок синій"}]

WordTranslation

WordTranslation["Bewegung","German"->{"English","French","Esperanto"}]

TextTranslation

TextTranslation["Über die von der molekularkinetischen Theorie 
der Wärme geforderte Bewegung von in ruhenden 
Flüssigkeiten suspendierten Teilchen; von A. Einstein."]

LanguageIdentify along with TextRecognize and TextTranslate

text = TextRecognize[]

LanguageIdentify[text]

germanText =TextRecognize[,Language->"German"]

TextTranslation[germanText]

TextStructure

TextStructure["The cat sat on the mat."]

TextStructure["The cat sat on the mat.","ConstituentGraphs"]

TextStructure["The cat sat on the mat.","DependencyGraphs"]

TextCases

Sentences, words, parts of speech, etc.

textData = ExampleData[{"Text","AliceInWonderland"}];

sentences = TextCases[textData,"Sentence"];
RandomSample[sentences,5]//Column

TextCases[Last@sentences,"Word"]

Grammatical units.

text =SortBy[sentences,StringLength]//Last

TextCases[text,"Word"]//Length

Grid[{#,Counts[TextCases[text,#]]}& /@ {"Noun", "Verb", "Adjective", "Adverb"},Frame->All]

Formatting-based or semantic choices, such as currency, phone number, color, language, etc.

TextCases["He spent $50 on the briefcase.", "CurrencyAmount"]

TextCases["You can contact Wolfram Research in India at  +91-80-26695890","PhoneNumber"]

TextCases["The colors of the rainbow are violet or purple, indigo, blue, green, yellow, orange and red","Color"]

TextCases["Hello and welcome. Et je suis francais. La casa es azul. And english again!", "English"]

Thank You

Initialization