lecture 09
NLP102
+
Sentiment Analysis
with CreateML
+
yet another little workshop
SeAts APp SEAtS ApP SEaTS APP
🧘
a Linkin Park MV to wake us up
after today's lecture:
-- solving more NLP basic tasks with Apple Natural Language Framework
-- sentiment analysis, from training to deployment
-- fun workshop on using chat AI to prompt text-to-X AI
Recap on last week

-- Introduction to NLP πŸŽƒ
-- Some basic NLP tasks solved with Apple NL framework
--- Language identification
--- Named Entity Recognition
--- Part-of-speech tagging
Extend to this week

Basic NLP tasks
--- Language identification
--- Named Entity Recognition
--- Part-of-speech tagging
--- Lemmatization (NEW❀️‍πŸ”₯)
--- Tokennization (NEW❀️‍πŸ”₯)
Higher-level NLP tasks
--- Sentiment analysis (NEW❀️‍πŸ”₯)
this one playground containing all basic NLP tasks in Apple NL framework
download and revise πŸŽƒ
---Language identification (line 1-57)
---Named Entity Recognition (line 59-101)
---Part-of-speech tagging (line 144-181)
open a new xcode playground, import the framework:
import NaturalLanguage 
import Foundation 
import CoreML
Tokenization
--1. Read about Tokenization: what is it about? πŸ₯·
--2. Copy relevant code from
line 103-142
--3. paste and run the example codes! πŸ•ΉοΈ
Lemmatization
--1. Read about Lemmatization: what is it about? πŸ₯·
--2. Copy relevant code from
line 183-212
--3. paste and run the example codes! πŸ•ΉοΈ
a very recent text-to-audio generation model with playable demo: Bark
Higher level NLP task -
Sentiment Analysis
EASY AND HANDY!
It's a classification task
input: text (sentence, paragraph, etc.)
output: what are the output classes?
output:
positive or negative
(or neutral)
sentiment analysis:
an approach to NLP that identifies the emotional tone behind a body of text
Same principles as image classification πŸ₯°
The only difference 😈 : different data modality -> different "numberification" scheme
CreateML takes good care for us again!
Training:
Data
(epinions3.zip )
Let's take a look at what "sentiment analysis" data should look like
the data: pairs of text with its label
Training:
-- 1. Download and unzip Data
-- 2. Read through this Apple Document
-- 3. Use this Playground for training
(don't forget to change the corresponding file path! )
(specify a cooler model name)
Deployment:
-- 1. Download and unzip app code
-- 2. Drop in your freshly trained model
-- 3. Run! (tested on MacOS)
ai artist of this week: Sofia Crespo
keywords:
biology-inspired AI; artificial biodiversity
lil workshop
- generate prompt for text-to-X models usig chat AIs
-- interact with text-to-image and text-to-audio generative AIs using the generated text prompts
text-to-image generative AIs
- SD
- this list of treasures
text-to-audio generative AIs
- AudioLDM
- bark
today we talked about:

Basic NLP tasks solved with Apple NL framework
--- Lemmatization
--- Tokennization
Higher level NLP task - sentiment analysis
--- CreateML training done on playground!!!
today we talked about:

-- using AI generated text to connect text-to-X models of different modalities πŸŒ‰