From 585f32b2a8ad8cac6ab047b0dfc4fb028715118e Mon Sep 17 00:00:00 2001 From: navanchauhan Date: Mon, 28 Jun 2021 00:53:27 +0530 Subject: added dataset --- ...2021-06-27-Crude-ML-AI-Powered-Chatbot-Swift.md | 44 ++++++++++++++++++ docs/feed.rss | 54 +++++++++++++++++++--- ...21-06-27-Crude-ML-AI-Powered-Chatbot-Swift.html | 50 ++++++++++++++++++-- 3 files changed, 138 insertions(+), 10 deletions(-) diff --git a/Content/posts/2021-06-27-Crude-ML-AI-Powered-Chatbot-Swift.md b/Content/posts/2021-06-27-Crude-ML-AI-Powered-Chatbot-Swift.md index 804ad97..7701c09 100644 --- a/Content/posts/2021-06-27-Crude-ML-AI-Powered-Chatbot-Swift.md +++ b/Content/posts/2021-06-27-Crude-ML-AI-Powered-Chatbot-Swift.md @@ -17,6 +17,32 @@ Disclaimer: This is a very crude proof-of-concept, but it does work. I opened a CSV file and added some sample entries, with a corresponding label. ![Screenshot of Sample Dataset](/assets/posts/swift-chatbot/intent-csv.png) + +```csv +text,label +hey there,greetings +hello,greetings +good morning,greetings +good evening,greetings +hi,greetings +open the pod bay doors,banter +who let the dogs out,banter +ahh that's hot,banter +bruh that's rad,banter +nothing,banter +da fuq,banter +can you tell me details about the compound aspirin,deez-drug +i want to know about some compounds,deez-drug +search about the compound,deez-drug +tell me about the molecule,deez-drug +tell me about something,banter +tell me something cool,banter +tell a joke,banter +make me a sandwich,banter +whatcha doing,greetings +i love you,banter +``` + ![Screenshot of Create ML Text Classifier](/assets/posts/swift-chatbot/create-intent.png) ## Word Tagging @@ -26,6 +52,24 @@ This model will be only called if the intent from the classifier is a custom act I created a sample JSON with only 3 examples (I know, very less, but works for a crude PoC). ![Screenshot of Sample Dataset](/assets/posts/swift-chatbot/drugs-json.png) + +```json +[ + { + "tokens": ["Tell","me","about","the","drug","Aspirin","."], + "labels": ["NONE","NONE","NONE","NONE","NONE","COMPOUND","NONE"] + }, + { + "tokens": ["Please","tell","me","information","about","the","compound","salicylic","acid","."], + "labels": ["NONE","NONE","NONE","NONE","NONE","NONE","NONE","COMPOUND","COMPOUND","NONE"] + }, + { + "tokens": ["Information","about","the","compound","Ibuprofen","please","."], + "labels": ["NONE","NONE","NONE","NONE","COMPOUND","NONE","NONE"] + } +] +``` + ![Screenshot of Create ML Text Classifier](/assets/posts/swift-chatbot/create-tagger.png) ## Time to Get Swift-y diff --git a/docs/feed.rss b/docs/feed.rss index 7056029..51f5890 100644 --- a/docs/feed.rss +++ b/docs/feed.rss @@ -4,8 +4,8 @@ Navan's Archive Rare Tips, Tricks and Posts https://web.navan.dev/en - Mon, 28 Jun 2021 00:50:20 -0000 - Mon, 28 Jun 2021 00:50:20 -0000 + Mon, 28 Jun 2021 00:52:32 -0000 + Mon, 28 Jun 2021 00:52:32 -0000 250 @@ -2045,8 +2045,33 @@ Disclaimer: This is a very crude proof-of-concept, but it does work.

I opened a CSV file and added some sample entries, with a corresponding label.

-

Screenshot of Sample Dataset -Screenshot of Create ML Text Classifier

+

Screenshot of Sample Dataset

+ +
text,label
+hey there,greetings
+hello,greetings
+good morning,greetings
+good evening,greetings
+hi,greetings
+open the pod bay doors,banter
+who let the dogs out,banter
+ahh that's hot,banter
+bruh that's rad,banter
+nothing,banter
+da fuq,banter
+can you tell me details about the compound aspirin,deez-drug
+i want to know about some compounds,deez-drug
+search about the compound,deez-drug
+tell me about the molecule,deez-drug
+tell me about something,banter
+tell me something cool,banter
+tell a joke,banter
+make me a sandwich,banter
+whatcha doing,greetings
+i love you,banter
+
+ +

Screenshot of Create ML Text Classifier

Word Tagging

@@ -2054,8 +2079,25 @@ Disclaimer: This is a very crude proof-of-concept, but it does work.

This model will be only called if the intent from the classifier is a custom action. I created a sample JSON with only 3 examples (I know, very less, but works for a crude PoC).

-

Screenshot of Sample Dataset -Screenshot of Create ML Text Classifier

+

Screenshot of Sample Dataset

+ +
[
+    {
+        "tokens": ["Tell","me","about","the","drug","Aspirin","."],
+        "labels": ["NONE","NONE","NONE","NONE","NONE","COMPOUND","NONE"]
+    },
+    {
+        "tokens": ["Please","tell","me","information","about","the","compound","salicylic","acid","."],
+        "labels": ["NONE","NONE","NONE","NONE","NONE","NONE","NONE","COMPOUND","COMPOUND","NONE"]
+    },
+    {
+        "tokens": ["Information","about","the","compound","Ibuprofen","please","."],
+        "labels": ["NONE","NONE","NONE","NONE","COMPOUND","NONE","NONE"]
+    }
+]
+
+ +

Screenshot of Create ML Text Classifier

Time to Get Swift-y

diff --git a/docs/posts/2021-06-27-Crude-ML-AI-Powered-Chatbot-Swift.html b/docs/posts/2021-06-27-Crude-ML-AI-Powered-Chatbot-Swift.html index 228b8e4..50c74a2 100644 --- a/docs/posts/2021-06-27-Crude-ML-AI-Powered-Chatbot-Swift.html +++ b/docs/posts/2021-06-27-Crude-ML-AI-Powered-Chatbot-Swift.html @@ -51,8 +51,33 @@ Disclaimer: This is a very crude proof-of-concept, but it does work.

I opened a CSV file and added some sample entries, with a corresponding label.

-

Screenshot of Sample Dataset -Screenshot of Create ML Text Classifier

+

Screenshot of Sample Dataset

+ +
text,label
+hey there,greetings
+hello,greetings
+good morning,greetings
+good evening,greetings
+hi,greetings
+open the pod bay doors,banter
+who let the dogs out,banter
+ahh that's hot,banter
+bruh that's rad,banter
+nothing,banter
+da fuq,banter
+can you tell me details about the compound aspirin,deez-drug
+i want to know about some compounds,deez-drug
+search about the compound,deez-drug
+tell me about the molecule,deez-drug
+tell me about something,banter
+tell me something cool,banter
+tell a joke,banter
+make me a sandwich,banter
+whatcha doing,greetings
+i love you,banter
+
+ +

Screenshot of Create ML Text Classifier

Word Tagging

@@ -60,8 +85,25 @@ Disclaimer: This is a very crude proof-of-concept, but it does work.

This model will be only called if the intent from the classifier is a custom action. I created a sample JSON with only 3 examples (I know, very less, but works for a crude PoC).

-

Screenshot of Sample Dataset -Screenshot of Create ML Text Classifier

+

Screenshot of Sample Dataset

+ +
[
+    {
+        "tokens": ["Tell","me","about","the","drug","Aspirin","."],
+        "labels": ["NONE","NONE","NONE","NONE","NONE","COMPOUND","NONE"]
+    },
+    {
+        "tokens": ["Please","tell","me","information","about","the","compound","salicylic","acid","."],
+        "labels": ["NONE","NONE","NONE","NONE","NONE","NONE","NONE","COMPOUND","COMPOUND","NONE"]
+    },
+    {
+        "tokens": ["Information","about","the","compound","Ibuprofen","please","."],
+        "labels": ["NONE","NONE","NONE","NONE","COMPOUND","NONE","NONE"]
+    }
+]
+
+ +

Screenshot of Create ML Text Classifier

Time to Get Swift-y

-- cgit v1.2.3