Tumgik
#Token soemthing
ancha-aus · 2 months
Text
RealAgeAU Drabble - Costume
I had a a few ideas for drabbles :3 And I settled on this one for now :3
Mostly because I have one mental image in my head that is just too cute to pass up and I wanted to add more cuteness to this AU so here we GO! @spotaus You ready my friend?
First drabble Prev Drabble Next Drabble
Als I am really considering making a masterpost for these drabbles and any related asks/answers and drawings people make... Just a thought.
*------------------*
Cross watches as Nightmare looks at the different options of costumes. They are in the bigger city nearby to actually give him some options.
It had been thanks to Crop that they even knew about this happening. Kinda like a halloween get together but it mostly celebrates the start of the colder seasons and the time of rest the land needs.
But with everyone in costume because Halloween happens around the same time.
But it gave them the excuse to take Nightmare out on a tiny trip and let him pick out soemthing he would like to wear. Killer says he is making progress on that front but Cross doubts it as Nightmare still just only wears the stuff they picked out for him or Dust's old things.
Even if Nightmare looks adorable in the for him much too big hoody.
Cross smiles down at Nightmare "And? Any ideas for what you want to be dressed as?"
Nightmare shoots him a look and shrugs "Why get dressed? I am a skeleton... That is spooky enough right?"
Cross feels part of his soul melt but tries to keep it in. Nightmare hadn't fully noticed that his way of speaking is starting to slip more and more into more childlike talking and words. Even if he still tries to speak in his fancy way. It is just too cute.
Cross sees it as them doing a good job at this whole parent thing.
Cross grins "True... But Horror already decided to go as a lumberjack and Killer is going as Jason from friday the 13th." Cross himself hadn't decided yet and Cross knows that Dust is planning on just matching whatever Nightmare wants to get dressed as.
Nightmare frowns and stares at all the options. He points towards a costume and Cross checks it.
It is the cheapest thing there is.
Cross saw this coming but he knows how to deal with that! Cross grins "Oh? A little devil? We can do that. Come. We can look at more costumes for that."
Nightmare looks a lot more unsure as he rubs his arm "This is fine... stuff is expensive."
Cross crouches down and leans on his hand "Hey... it is fine... Dust got a budget together and everything. Let me worry about money okay?"
Nightmare frowns but looks considered at some of the more detailed options instead of the cheap stuff. Much better. Nightmare slowly starts to gravitate towards the vampire stuff and Cross starts to think this may be a success when-
a soft sizzle.
Oh are you kidding him!?
"You seriously gonna let him get that stuff?"
Nightmare blinks and grins brightly at the sound of Error and searches for him before spotting him near the ceiling.
Cross glares and hisses "Error." he glances around nervously.
Error snorts "Calm down. I know how to time stuff. People hardly ever notice I am in universes. Seriously though. yOu are going to let him grab this shi-stuff." Error quickly changes his sentence when Cross glares at him.
Cross crosses his arms "Well we want to have stuff to get dressed in for the party. We are trying to fit in."
Nightmare looks up at Cross and smiles a tiny bit "Error can look with us?"
Cross really wants to say no. Not like Killer. Killer hates the fact that Nightmare has a crush on the other. Cross just doesn't want to deal witht he headache that is Error himself.
Now that Cross knows what he knows he realised that Nightmare always had a crush on Error. No one ever noticed because... well... Nightmare went about those feelings as any six year old did. hanging out, trying to invite the other to play with them. bringing small tokens and things. trying to be included.
Error snorts "Nah. Don't want to be stuck in this store of bad quality." and he nudges one of the costumes offered.
Cross sighs annoyed "So why appear?"
Error looks smug "I saw you were going to let Nightmare grab bad quality stuff. of course i step in."
That is another thing Cross doesn't like. Knowing that Error just, glances in whenever he feels like it. Cross glares and hisses "Stop having a window on us open. One it is weird and two if anyone sees it!"
Error waves it off "I just check for a few seconds when i know it is clear. Calm down." he shoots Ngihtmare a look "Seriously though. You are a god. don't gods deserve like the best things?"
Nightmare shrugs and mutters "Jsut got stuff because they wanted it..."
Cross also finds it rich coming from Error as Error still wears some upgraded hobo-jacket that looks like it is barely holding it together.
Error blinks before huffing "Yeah no. I am getting you a costume of actual quality." he looks areound "vampire?"
Nightmare suddenly looks a lot less comfortable with the attention adn returns to Cross's side to hide partly. Nightmare never likes it when others start offering stuff to him. Cross leans downa dn picks up their small charge.
Cross nudges their skulls together and mutters "It is okay. You had an idea of what you like?"
Nightmare just pushes clsoer "it is dumb. easy stuff is fine."
Cross nudges him again "It isn't dumb. What do you want?"
Nightmare remains quiet for a long time and Cross waits patiently. Just let him feel it out first. Let him decide for himself. Error looks a lot less patient as he just stands there, obviously wnating to tap his foot but refrains from it.
Nightmare eventually mutters "liked... vampire becuase it is a bat..."
Cross blinks and grins "You want to be a tiny bat?"
Ngihtmar eshrugs again and tries to hide further. Clearly done with being verbal.
Cross nods and nzuzles the skull "I am sure we can figure out a tiny bat costume." MAybe they can get a cape? get some wings attached? Cross is srue they can figure it out-
Error nods "A bat. That is easy." he looks thoughtful before nodding and with a sizzle he is gone.
Cross sighs loudly but Ngihtmare giggles and gives a happy mutter "He likes me."
Cross sighs loudly "You are very clearly he favourite. Which isn't a good thing bud, you don't want to be a god's favourite." at least that is the lesson Cross got out of stories.
Nightmare hums as he nuzzles his skull against Cross's "You guys were always my favourites..."
Cross hugs Ngihtmare close as he walks towards the exit of the store "You are so sweet. and you always cared so much about us." Ngihtmare mutters about not being sweet but relaxes with the affection.
Cross gets a ride back from Ellie and returns home to the others. He is only done for a few minutes with retelling everything as they make sure Nightmare eats his snack when they hear more sizzling.
A moment later a small package drops on their dining table.
Nightmare blinks nad opens it only to gasp.
Because that is a bright purple hoody with bat wings sewed in the back and a hood with little bat ears and a grumpy bat face on the hood.
It is adorable and Nightmare looks adorable in it and Cross has to admit it was a perfect pic. a very comfortable and cute costume for the coming outing.
Killer grumbles as he stabs his fork into his own food. He glares at his plate "Gonna have to figure out how to scare a god."
Yeah... Cross is hoenstly a little curious as to how Kilelr plans to do that. For now their babybones is happy in his new hoody and they have a very powerful ally who wants Nightmare happy like them.
*------------------*
Was this whole drabble an excuse to get Nightmare a hoody with little bat wings and bat ears? Yes. Yes it was. And he HAS one now!! :D <3
First drabble Prev Drabble Next Drabble
55 notes · View notes
Note
I'm half convinced it was Roberto's idea tos tsrt traveling with Vash anyways cuz at the end of ep 3 Vash was walking off, alone, while Meryl just watched him. Next episode opens with him in the backseat of the truck asleep while Roberto informs Meryl that Vash hasn't eaten in days. Clearly, something happened in between that led to Vash being coaxed into traveling with the reporters and while Meryl probably had soemthing 5o do with it I'm half convinced Roberto wasn't too against going after him, not when right before everything went to shit he was having a heart to heart with Vash about how he's running scared
Ooooooooh. I see what you mean! I can totally see that being a possibility! SDFLSDHGILFGHDFLHAHGDFG Roberto has to put up a token resistance but honestly he's not as grouchy about it as he claims xD YEAH AND THE HEART TO HEART. ROBERTO YOU AIN'T FOOLING US.
8 notes · View notes
If your wondering why I'm not posting daily. I got sick this last weekend (haven't gone anywhere just happens when caring for my disabled mom, and well with my dads line of work hes always infront of others who are in all sorts of conditions.. hes the kind ot cough without covering up. So I'm a petri dish if he bring home germs n' stuff or mom does from her appointments wether wearing or without masks... (were a mask wearing family even before the pandemic due to this fact and mom being heavily asthmatic)
Thus last week been dealing with a stomach crude. I keep thinking I'm over it then a day later stomach feels iffy again and its almost a repeat. Luckily, it's not as bad as the first two days I mean, God willing and fingers crossed. But it's difficult to concentrate or do much. Muscles soar, hace a pile😭😱😓😩😨😱 of things to do and everyday I need to get to and thsi is holding me back from.🤒🤢🤕🤮😷🤒😵 Sp under the weather lately. I wake up often and I think Yeah it will be good, or I'll be good & I take a turn for the worst. I nearly threw up several times today. If it lasts for another two days I'm gunna head to the doctor. But this is just annoying for me as it may be for you. It also may or may not be one of the reasons for several recent all nighters. Friday I slept over 12 hours despite thinking I was Okay I was shocked and still felt beat for most of teh day lien I wanted more sleep... I woke today with a strong heavy (for me didnt go over 100 or anything but still wants considered high for me) fever and felt sick for hours.
Just keeping you updated that updates may remain slow till I can beat this. With it being stomach crude I defiently have energy. Drawing is legit one of the few ways (including above writting as that doesnt settle my stomach as often as I'd hope in these tokens due to focus... I think it's the feeling of drawing on paper and not the computer thst calms my nerves or soemthing or the motions against the teeth of teh paper [the bumps on a paper my art teacher at college called teeth, also some call it grooves. Her vocab for it just stuck with me🤣😂]).
I can get my mind not to focus on it and can settle down the sickening feeling by usually drawing and on s ok me occassions reading. Today read outloud and talked out a story I bbn hadn't touched much lately, it helped me settle when I was near hurling before that.
But that being said, I may want to wait to made while sick before I outline them is still up to par... To make sure what I make when I'm sick is actually up to par with what I want to post. I do have old stuff I can post. It's just the process of the pictures, trying to jot get the glare and stuff that keeps me from doing it I may have one or two potential picks I can share at the moment. But I have ti feel good enough to go through it. Literally was holding in the need to hurl while writting thus as I'm trying to distract myself from being sick. But it's a one step at a time situation.
Just keeping you up to date. Take care everyone. Stay healthy out there.
💖🥰😍
2 notes · View notes
peniswizard69 · 5 months
Text
I saw a post saying there was no fully straight Team Tardis since the Ponds and like I am sorry but I'm going on a rant
Counting Clara as a win for the queer rep off of a single throwaway line where she says Jane Austen is a good kisser and Liteally Nothing Else is borderline biphobic (hyperoble) like "Clara is bi" is about as founded a reading as "Clara got shitfaced and some dude named Brad or Chett or soemthing dared her and Jane Austen to make out and the only reason it turned her on is that she was making aggressive eye contact with The Doctor and he was visibly uncomfortable" like you are NOT even taking crumbs you are taking a single solitary mold infected crumb. If it was more than that I'd reject it as tokenism but it's worse, it's fetishism. I'm so mad. Reminds me of when Mabel Pines won the ADHD character tournament, she doesn't have ADHD she's a cloudcuckoolander and conflating the two is abelist. I want to bite
1 note · View note
Text
Kevin: *walks into the room* Good morning everyone!
Token: Good morning.
Craig: Good morning.
Tweek: Good morning.
Jimmy: Good morning.
Kevin: You all sound like robots! ‘Good morning, good morning’. Come on spice it up a bit!
Clyde: *walks in* HEY MOTHERFUCKERS!
201 notes · View notes
stupidjewkyle · 4 years
Text
sp hc- how they would respond if you said “i love you”
stan: woah thank you- i mean i love you too!
kyle: wait really?! me too!!
cartman: HAHHAHAHAHA thats so fucking faggy!
kenny: oh baby i know
craig: okay? what do you want a medal or soemthing?
tweek: ah! what!? you do?!
clyde: thanks babe
token: aww i think i love you too...i think
84 notes · View notes
thechindiannerd280 · 4 years
Text
Her Little Rose (Holmesbury Ficlet)
I’ve been super busy with my lab but I finally got to write the fic! Sorry for the wait, but sometimes my time management skills get the best of me and I end up stressing about assignments that could have been done in an hour. Anyways, enjoy! This is pretty short and some of my fics will be smaller than others, but if you have any ideas, please feel free to send an ask or message me!
The moment she was laid in her arms, Enola knew what she would call her.
She was a beautiful baby. Small, delicate, and absolutely beautiful. Enola stared lovingly at her daughter, gently rocking her back and forth and running her finger over the thin wisps of brown hair that covered her head. Her eyes were closed at the moment, but Enola knew she had her father’s eyes. As Enola leaned forward to plant a kiss on her pink cheeks, Tewksbury took a seat on the bed next to his wife.
“Rose,” said Enola, sighing as her eyelids grew heavy. “Our little Rose. Do you remember that day?” She turned to her husband and gave a tired smile.
“Of course,” said Tewksbury. “The day you found me at Covent Garden. I gave you a rose to thank you.”
“Do you recall the color?”
“Bright pink. Symbolic of grace and gentleness, often given as a token of appreciation,” said Tewksbury with a smile. Enola nodded, happy that he remembered. She looked at her daughter and saw her husband doing the same. They sat in a comfortable silence before she spoke.
“I wanted to name her Rose not only because she’s just like one, but I wanted to honor the day I came back to you.” Enola looked up and smiled. “I truly appreciate every moment and decision we’ve made together.”
“I appreciate you too,” said Tewksbury, wiping a small tear from the corner of his eye. “This is just so surreal. One moment we’re jumping from trains and now, we have a child? Quite the adventure,” he added with a chuckle.
Enola laughed, ignoring the pain in her stomach. Yes, they are parents now. It felt like it was just yesterday when they were teeangers, running around London with no idea how the outside world worked. Now, they have a child to raise, to love, and most importantly, to teach. Enola knew being a woman of the day was a tough life, having witnessed and experienced the injustice women suffered from and she vowed to do everything in her power to teach her daughter to be strong, independent, and to fight for change. Finally feeling the exhaustion from childbirth and excitement, she leaned back and closed her eyes.
“Looks like Rose and I will be doing some father daughter bonding,” said Tewksbury as he stood up. “You should rest, Enola. You had a long and hard day.”
Barely awake, Enola allowed her husband to take Rose out of her arms. As tired as she was, she still refused to sleep. She opened her eyes one last time to witness Tewksbury sitting in her rocking chair, holding Rose close to his chest. Before sleep completely overtook her, she heard him say soemthing that made her heart fill with happiness.
“I hope you like plants because we’re going to make you your very own garden. Fill it with roses, tulips, and chrysanthemums. They’re your mommy’s favorite, you know.”
36 notes · View notes
rat-shark · 5 years
Text
This is the worst fucking thing ever
Tumblr media
Snowflake and fucking Safecpace??? To whoever thought this was a good idea: I don't want to talk I want to fucking beat you up.
I just- I just cant
Maybe they'll actually be really great characters, I don't know. But I hate how Snowflake is the token nonbinary character. If they're gonna make a token soemthing character at least fucking TRY
Like Marvel, what on Earth are you trying to achieve. Queer people are gonna be mad because these characters are terrible representation and "anti sjws" are going to be mad because "sjw bad"
Anyway I headcanon B-negative as nonbinary. A funky 90-s obsessed goth vampire? That's what the fuck I'm talking about
201 notes · View notes
Text
In a after school kinda place
People where gambling
I was tired and sleeping on my arms
Then I woke up
There was a cute girl
She wrote a cute note with beautiful cursive
It siad
Racing is kinda like a king sport
Or soemthing like that
I woke up said
Maybe I'll stay awake if I gamble
I went to get tokens
She came from behind
And did the tap on shoulder thing left and right
I yelled ur so annoying
She left with her back turned
Not looking back
I got back
I
I then say the note
It was such a sweet note
I tried to go find her
I couldnt
I went on gambling at a slot machine
I won 8 dollars
Then went on to win maybe 400
I left after winning cuz that's how u win
I went and saw a empty stage area
It was so real.
Everything was
I had a box of rice
Strangely It was bubbling up
Next to Alan and Ken ..
So I threw it away
Then I saw the note
The other stuff she wrote I didn't recall
But
Racing is a kings sport
0 notes
jenjeanpierre · 6 years
Photo
Tumblr media
I’m the queen of confusing humility with shrinking myself but no more. I am thankful and grateful for all who have helped me along the way but at the end of the day I recognize that it was my hard work, perseverance, and belief in myself that inevitably got me anywhere that I am- good or bad. It’s funny when good things happen to you, how so very quickly people come out of the woodwork looking for credit one Way or the other. That’s fine and all but I’m no longer going to give those people permission to get ALL the credit. It takes a village. It’s takes a village for everything. But in the same token, it takes the person you connected with another or offered tools and resources the WANT to actually use those resources and do so. Basically you can lead a horse to water but can’t make them drink. So now when someone compliments me on a great opportunity, I’m retraining myself to stop saying “thanks to you” and instead a mere “thank you”. It’s not that I won’t show gratitude or give credit where and when it is due but it’s that I have a tendency to forget myself when giving credit. I sometimes take this unselfishness trait of mine far too far and leave my own self high and dry. But in closing, I do have to shout out the incredible @bthartistry for this makeup though. I’ve had my makeup done 4 times in my life and all have been incredible but this time it was for soemthing that really had the potential to open some MAJOR doors for me and this “face beat” gave me so much extra confidence. Enjoy your Tuesday ladies and gents and don’t you ever shrink yourself to make others feel big! 💕 Hair: @cosmocrush #thecutlife #teamnatural_ #curlyhairstyles https://www.instagram.com/p/Bmd1PprFHUQ/?utm_source=ig_tumblr_share&igshid=798etgm0e6fh
0 notes
iyarpage · 6 years
Text
AI Basics: Natural Language Processing with Node.Js
For a couple of years now, AI and Machine Learning have been taking over web forums as well as adding to the excitement of eager developers who are keen to give it a go in their projects. I’m by no means a Machine Learning expert, but I have brushed the surface of it in a couple of development projects which required a “smarter” way of doing things.
To be clear, what we’re going to explore today is only the tip of the iceberg when it comes to Machine Learning and my examples are going to be quite rudimentary, however Natural Language Processing is quite an exciting prospect and has some amazing, yet creative use cases for your projects, examples of those would be:
More intelligent search suggestions and search results
Chatbot integration for a better understanding of user input / conversation
Text to Speech integrations, similar to services like Amazon Polly
Content editing features for content producers like spell checks, syntax and more.
What is NLP?
Natural Language Processing by definition as stated on Wikipedia, refers to: “the application of computational techniques to the analysis and synthesis of natural language and speech.” – Lets break that down.
An NLP library will help you perform relatively complicated data extraction on string. Ever searched on Google and spelled a word incorrectly? Ever noticed how Google then tells you, “Displaying results for x as well” – well that’s some NLP at work. The search form on Google’s home page is incredibly complex when it comes to analyzing what, we as humans have typed into the form input.
NLP is usually performed on a string of words.
As a developer using an NLP library I can extract a ton of information that could help perform almost any task I like. For this project, we’ll be using Natural.
For the sake of brevity I’m just going to cover the most useful methods that would be quick to implement into your own projects and iterate on.
I found this article title on Web Designer Depot:
“The Secret Designer: First Job Horror”
Analyzing the entire string is one thing, but we want to be able to perform methods on individual words in order to extract more data from them. Luckily, we can use a tokenizer to do so, have a look below:
Tokens
var nlp = require('natural'); var tokenizer = new nlp.WordTokenizer(); console.log(tokenizer.tokenize("The Secret Designer: First Job Horror"));
This will return a simple JS array to our program:
[ 'The', 'Secret', 'Designer', 'First', 'Job', 'Horror' ]
The WordTokenizer simply breaks up the string into words that we can iterate and perform methods on. Interestingly, the Natural library comes with a few different tokenizers.
Natural has collected a number of algorithms written by some very smart people to perform the functionality we will discuss, there’s a few ways to skin a cat in these examples so if you’d like to dive a bit deeper, all the information is on the Natural Github page.
String Distance
Natural uses the Levenshtein distances algorithm as a way of determining if two strings match:
var nlp = require('natural'); console.log(natural.LevenshteinDistance("Daine","Dane"));
The above will log out 1 meaning that the two strings match in context of the algorithm. As you can see, there are many ways of spelling “Daine” – Levenshtein distances can get incredibly complex as it uses a number of parameters referred to as:
insertions
substitutions
deletions
In the example above, we have inserted an i thus the Levenshtein distance will compute the string based on an insertion. This method is very useful for providing suggestions based on bad spelling.
Approximate String Matching
Another great piece of functionality that could really spice up your apps is Approximate String Matching. Similar to “String Distance” above.  In fact, it implements the Levenshtein algorithm. This method is better for strings with more context or some kind of entity (ie, A city, country, person, etc) that could be spelled wrong within a string.
Phonetics
For words that sound the same, yet have a different meaning, the metaphone.compare() method is incredibly useful.
var nlp = require('natural'); var metaphone = nlp.Metaphone; if(metaphone.compare('see', 'sea')) {   console.log('Phonetically they match!'); }
Spellcheck
Spellchecks can be used in a dynamic way, this kind of functionality is great if you are rewriting spellcheck functionality in your app, or maybe you’re building some kind of word processing tool.
var checks = ['something', 'soothing']; // Known as a corpus var spellcheck = new nlp.Spellcheck(checks);
We could then run:
spellcheck.getCorrections('soemthing', 1); // ['something']
Dictionary
Wordnet is the latest integration in Natural. It’s a dictionary database developed by Princeton University which allows for the instantaneous lookup of words, including all meta associated with that word. Examples of meta would be verbs, adjectives and synonyms.
Wordnet requires that you install the wordnet-db NPM package in order to run keywords against it. You can install it into your projects by typing:
npm install wordnet-db
This bundled functionality has some big implications for standardizing the the native dictionary lookup that generally most operating systems bake in to browsers and software. Coupled with libraries like React, developers could take this pretty far.
Example
Okay! So how about a full example then? Let’s build a simple CLI tool that will prompt us for a word and then return a dictionary look up. Please note that for the sake of brevity, I have left out checks and error handling. As Node.js has support for promises, it would be easy enough to add this in to the logic flow.
First, create a folder whose name is whatever you would like to call your app. Next, cd into the folder and run:
npm init -y
This will create a blank package.json. There is one property that is important here and that is main which tells the Node.js application to run from this file. Keep it as index.js and create the file in the same folder as the package.json, you can do that on the CLI by typing:
touch index.js
Next up, we’ll want to install a couple of dependencies:
npm install --save commander wordnet-db natural
Commander.js is a powerful package for NPM that makes writing CLI based applications a breeze. We’ve already covered Natural in this post.
Open up index.js and paste the following on the very first line of the file:
#!/usr/bin/env node
This line tells Node to execute the file when we npm link our dictionary app to usr/local/bin, as in to use it as a program with flags, for instance:
dictionary lookup “HTML”
Lets add two more properties to our package.json:
"preferGlobal": true, "bin": "./index.js"
preferGlobal will allow us to run our package anywhere in our OS, the bin property simply tells NPM link what file to execute. Make sure you’re in your project folder and run:
npm link
I’ve added the completed package.json and index.js as a Gist below:
https://gist.github.com/dainemawer/d4dc972fd2c0db5e58615c13c17ca8aa
Here’s an explanation:
First, we require commander, wordnet and natural  from node_modules.
We’ll come back to the wordNetLookup function in a bit.
We can call program multiple times, in this application I’ve called it three times.
The first call sets up the version and description.
Next we setup a command. This command will take one required parameter <word>
We then provide it an alias in case you don’t want to type out the lookup everytime you run the program.
We then add a description for what the command does and finally we run .action()
The action method is fed a callback function which takes the word the user typed on the terminal as a parameter. Within this call back, we run wordNetLookup() which passed down the fed parameter and performs the lookup.
We can now run dictionary lookup “word” and the program will perform the lookup of any word that’s currently in the WordNet database.
And that’s it! I hope you’ve enjoyed this crash course into NLP. In my next article we’ll look at NER, or otherwise known as Natural Entity Recognition, which will allow us to extract data from real things like cities, people and countries. Coupled with NLP, NER provides some seriously powerful integrations into our Node-based applications.
Add Realistic Chalk and Sketch Lettering Effects with Sketch’it – only $5!
Source p img {display:inline-block; margin-right:10px;} .alignleft {float:left;} p.showcase {clear:both;} body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;} AI Basics: Natural Language Processing with Node.Js published first on https://medium.com/@koresol
0 notes
unixcommerce · 6 years
Text
AI Basics: Natural Language Processing with Node.Js
For a couple of years now, AI and Machine Learning have been taking over web forums as well as adding to the excitement of eager developers who are keen to give it a go in their projects. I’m by no means a Machine Learning expert, but I have brushed the surface of it in a couple of development projects which required a “smarter” way of doing things.
To be clear, what we’re going to explore today is only the tip of the iceberg when it comes to Machine Learning and my examples are going to be quite rudimentary, however Natural Language Processing is quite an exciting prospect and has some amazing, yet creative use cases for your projects, examples of those would be:
More intelligent search suggestions and search results
Chatbot integration for a better understanding of user input / conversation
Text to Speech integrations, similar to services like Amazon Polly
Content editing features for content producers like spell checks, syntax and more.
What is NLP?
Natural Language Processing by definition as stated on Wikipedia, refers to: “the application of computational techniques to the analysis and synthesis of natural language and speech.” – Lets break that down.
An NLP library will help you perform relatively complicated data extraction on string. Ever searched on Google and spelled a word incorrectly? Ever noticed how Google then tells you, “Displaying results for x as well” – well that’s some NLP at work. The search form on Google’s home page is incredibly complex when it comes to analyzing what, we as humans have typed into the form input.
NLP is usually performed on a string of words.
As a developer using an NLP library I can extract a ton of information that could help perform almost any task I like. For this project, we’ll be using Natural.
For the sake of brevity I’m just going to cover the most useful methods that would be quick to implement into your own projects and iterate on.
I found this article title on Web Designer Depot:
“The Secret Designer: First Job Horror”
Analyzing the entire string is one thing, but we want to be able to perform methods on individual words in order to extract more data from them. Luckily, we can use a tokenizer to do so, have a look below:
Tokens
var nlp = require('natural'); var tokenizer = new nlp.WordTokenizer(); console.log(tokenizer.tokenize("The Secret Designer: First Job Horror"));
This will return a simple JS array to our program:
[ 'The', 'Secret', 'Designer', 'First', 'Job', 'Horror' ]
The WordTokenizer simply breaks up the string into words that we can iterate and perform methods on. Interestingly, the Natural library comes with a few different tokenizers.
Natural has collected a number of algorithms written by some very smart people to perform the functionality we will discuss, there’s a few ways to skin a cat in these examples so if you’d like to dive a bit deeper, all the information is on the Natural Github page.
String Distance
Natural uses the Levenshtein distances algorithm as a way of determining if two strings match:
var nlp = require('natural'); console.log(natural.LevenshteinDistance("Daine","Dane"));
The above will log out 1 meaning that the two strings match in context of the algorithm. As you can see, there are many ways of spelling “Daine” – Levenshtein distances can get incredibly complex as it uses a number of parameters referred to as:
insertions
substitutions
deletions
In the example above, we have inserted an i thus the Levenshtein distance will compute the string based on an insertion. This method is very useful for providing suggestions based on bad spelling.
Approximate String Matching
Another great piece of functionality that could really spice up your apps is Approximate String Matching. Similar to “String Distance” above.  In fact, it implements the Levenshtein algorithm. This method is better for strings with more context or some kind of entity (ie, A city, country, person, etc) that could be spelled wrong within a string.
Phonetics
For words that sound the same, yet have a different meaning, the metaphone.compare() method is incredibly useful.
var nlp = require('natural'); var metaphone = nlp.Metaphone; if(metaphone.compare('see', 'sea')) {   console.log('Phonetically they match!'); }
Spellcheck
Spellchecks can be used in a dynamic way, this kind of functionality is great if you are rewriting spellcheck functionality in your app, or maybe you’re building some kind of word processing tool.
var checks = ['something', 'soothing']; // Known as a corpus var spellcheck = new nlp.Spellcheck(checks);
We could then run:
spellcheck.getCorrections('soemthing', 1); // ['something']
Dictionary
Wordnet is the latest integration in Natural. It’s a dictionary database developed by Princeton University which allows for the instantaneous lookup of words, including all meta associated with that word. Examples of meta would be verbs, adjectives and synonyms.
Wordnet requires that you install the wordnet-db NPM package in order to run keywords against it. You can install it into your projects by typing:
npm install wordnet-db
This bundled functionality has some big implications for standardizing the the native dictionary lookup that generally most operating systems bake in to browsers and software. Coupled with libraries like React, developers could take this pretty far.
Example
Okay! So how about a full example then? Let’s build a simple CLI tool that will prompt us for a word and then return a dictionary look up. Please note that for the sake of brevity, I have left out checks and error handling. As Node.js has support for promises, it would be easy enough to add this in to the logic flow.
First, create a folder whose name is whatever you would like to call your app. Next, cd into the folder and run:
npm init -y
This will create a blank package.json. There is one property that is important here and that is main which tells the Node.js application to run from this file. Keep it as index.js and create the file in the same folder as the package.json, you can do that on the CLI by typing:
touch index.js
Next up, we’ll want to install a couple of dependencies:
npm install --save commander wordnet-db natural
Commander.js is a powerful package for NPM that makes writing CLI based applications a breeze. We’ve already covered Natural in this post.
Open up index.js and paste the following on the very first line of the file:
#!/usr/bin/env node
This line tells Node to execute the file when we npm link our dictionary app to usr/local/bin, as in to use it as a program with flags, for instance:
dictionary lookup “HTML”
Lets add two more properties to our package.json:
"preferGlobal": true, "bin": "./index.js"
preferGlobal will allow us to run our package anywhere in our OS, the bin property simply tells NPM link what file to execute. Make sure you’re in your project folder and run:
npm link
I’ve added the completed package.json and index.js as a Gist below:
https://gist.github.com/dainemawer/d4dc972fd2c0db5e58615c13c17ca8aa
Here’s an explanation:
First, we require commander, wordnet and natural  from node_modules.
We’ll come back to the wordNetLookup function in a bit.
We can call program multiple times, in this application I’ve called it three times.
The first call sets up the version and description.
Next we setup a command. This command will take one required parameter
We then provide it an alias in case you don’t want to type out the lookup everytime you run the program.
We then add a description for what the command does and finally we run .action()
The action method is fed a callback function which takes the word the user typed on the terminal as a parameter. Within this call back, we run wordNetLookup() which passed down the fed parameter and performs the lookup.
We can now run dictionary lookup “word” and the program will perform the lookup of any word that’s currently in the WordNet database.
And that’s it! I hope you’ve enjoyed this crash course into NLP. In my next article we’ll look at NER, or otherwise known as Natural Entity Recognition, which will allow us to extract data from real things like cities, people and countries. Coupled with NLP, NER provides some seriously powerful integrations into our Node-based applications.
Add Realistic Chalk and Sketch Lettering Effects with Sketch’it – only $5!
Source p img {display:inline-block; margin-right:10px;} .alignleft {float:left;} p.showcase {clear:both;} body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
https://www.webdesignerdepot.com
The post AI Basics: Natural Language Processing with Node.Js appeared first on Unix Commerce.
from WordPress https://ift.tt/2qKIwLj via IFTTT
0 notes