I’m very excited to have contributed a chapter on the antipassive in Babungo in this volume on RRG in African languages. Coming May 2023!
https://www.degruyter.com/document/isbn/9783110795295/html?lang=e
Conversational AI | Linguistics | Development
I’m very excited to have contributed a chapter on the antipassive in Babungo in this volume on RRG in African languages. Coming May 2023!
https://www.degruyter.com/document/isbn/9783110795295/html?lang=e
Since a computer cannot analyze text in its raw form, it must be converted into a numerical format – vectorization. One way to vectorize text data is TFIDF.
When dealing with textual data, it’s important to know which words are most important in a given document. For instance, if you’re trying to retrieve textual data on a particular topic, certain unique words may be more informative than generic words that occur very frequently.
While a straightforward count vectorizor will provide insight into how frequently a term occurs in a given document, a TFIDF (Term Frequency Inverse Document Frequency) approach will tell you whether or not to prioritize a word in a given document.
TFIDF is equal to: term frequency * inverse document frequency.
In simple terms:
Term frequency (TF) refers to how often a term occurs in a given document divided by the total number if words in that particular document.
Inverse document frequency (IDF) tells us which terms or words occur frequently across all documents and which ones occur rarely. Terms that are very common have a lower IDF and vice versa.
Our TFIDF score gives the words in a given document a weightage which provides an insight into which words in the text are most and least informative.
The most informative are those with a higher score in a given document and those with a lower score are less informative (commonly used words). It assigns a score rather than a frequency.
Doc 1: “I think that the purple sweater is the best choice for the event”
Doc 2: “She thought that the pink jeans were the best for the event.“
Doc 3: “I think the the best choice for the event is the red dress”
The word the occurs a lot and has a high frequency count.
But words like purple, sweater and jeans provide more information on the person’s personal clothing choice. That’s the magic of TFIDF.
Do you have any favorite resources on this topic?
Honoured to have a chapter entitled “An Analysis of Non-Iconic Word-Order in the Bamunka Reference Phrase” in this volume – “Challenges at the Syntax-Semantics-Pragmatics Interface: A Role and Reference Grammar Perspective” edited by Robert D. Van Valin Jr.
Check it out below.
“Will you have a cup of tea?” – “No, no, no…” – “Go on, you will” – “No really, I’m fine!” – “You will, just a half-cup” – “Oh okay, just a half cup”.
This is a typical conversation you might witness upon entering an Irish home when I was growing up. The three to four turn polite decline, the modification of the offer, the giving in of the half-cup tea drinker. But in some cultures, this up front refusal of the offer may be interpreted as rude or ungrateful.
When designing virtual agents, be they chatbots or voice bots, an awareness of cultural context and social norms around areas such as politeness may make all the difference in a natural, seamless and comfortable user experience. Existing research in fields such as sociolinguistics can inform these design choices. Of course, nuance applies and not all generalizations will hold in every situation, but valuable insights are available to us if we consult the research!
For example, research by Hass & Wächter (2014) found that Japanese and German cultures present two opposite poles of a continuum when it comes to directness/indirectness of speech. A German communicative style favored the former – being more task oriented. The Japanese style favored the latter – valuing group orientation. Research on politeness has also been carried out in the setting of healthcare. Backhaus (2009) presents a cross-cultural comparative study of elderly care home interaction in Japan with elderly care home interactions in a range of different cultural and linguistic contexts. It was found, for instance, that praise, if applied out of context and in too exaggerated a manner, can be interpreted as another expression of the unequal power relations between residents and staff that characterize everyday life in the institution.
Consulting the research on topics like power dynamics and culturally specific values surrounding politeness are a valuable tool in the conversation designers kit.
What unique politeness principles are present in your culture?
Resources:
Hass & Wächter (2014) Culture and the Question of Impoliteness in Computer-Mediated Communication: a research gap. DOI: 10.18247/1983-2664/educaonline.v8n1p1-12
Backhaus (2009) Politeness in institutional elderly care in Japan: A cross-cultural comparison Journal of Politeness Research 5 (2009). DOI: 10.1515/JPLR.2009.004
Intents and slots are central to the Alexa skill building process, but what are they exactly?
𝐈𝐧𝐭𝐞𝐧𝐭𝐬
Intents consist of names and a list of “utterances”. The latter are the various ways in which a user might ask Alexa a question.
For example,
Name: “RestaurantIntent” Utterances: “Where can I find a good restaurant” or “What’s a good place to eat”.
Machine learning processes will cater for many more ways in which customers might ask this based on the utterances you add.
Each intent is “handled” at the backend, using AWS lambda for instance, and provides appropriate responses for each intent.

𝐒𝐥𝐨𝐭𝐬
Words that express variable information such as names and locations can be allocated as slots.
Such words can be highlighted in the original utterance using curly braces {}
You can then create a new slot name such as StreetName
You then assign your slot name to a slot type such as dates or place names.
These types can be built-in or custom made.


Hope these snippets are helpful 🙂
You’ve probably heard of HTML but possibly not SSML. Where HTML is used to describe the structure of a web page, SSML (Speech Synthesis Markup Language) is an XML based markup language used in speech synthesis applications. It controls aspects of synthesized speech such as pronunciation, emphasis, pitch and rate. The Alexa Skills Kit supports a subset of SSML tags to make your Alexa skill more personable and customizable. Cool features include things like adding emotions such as “excited” or the addition of audio files to your app. Note – If you’re using the Alexa Skills Kit SDK for Node.js or Java you don’t need to use the <speak> tags!

Have you used SSML before?
For more info on using SSML with your Alexa App check out this documentation: https://developer.amazon.com/en-US/docs/alexa/custom-skills/speech-synthesis-markup-language-ssml-reference.html
I’ve recently started working with MongoDB for database management and thought I’d write a short note on my current learnings. In the past, I’ve used SQLite and PostgreSQL. The distinguishing feature between MongoDB and the former approaches is whether we are dealing with a relational model of data management or a document-oriented model. MongoDB is what is known as a NoSQL (‘not only SQL’) approach.
In contrast to a relational system like PostgreSQL which makes use of traditional tables that store structured information, MongoDB uses a document-oriented data storage model. It’s a non-relational model that stores unstructured data in JSON-like documents. This may be particularly helpful for unstructured data such as emails or text files. However, MongoDB can also deal with structured data like data and zip-codes – just in a different way to a table-based model. Documented-oriented approaches can allow for greater flexibility and easier scaling.
For Node users like myself – there is an npm module for MongoDB that makes reading and writing from the database with Node very straightforward.
As someone who is still learning, I’d love to hear your thoughts on the benefits and downfalls of a relational versus non-relational approach.
Learn more here: https://www.mongodb.com/nosql-explained
So, the ES6 feature of arrow functions is not unique to Node.js, but they will be helpful to know as a more concise alternative to a regular function if you’re not already family with them. Both standard and shorthand arrow functions exist.
An ES5 function is compared with a standard ES6 arrow function below:


Both will produce a result of 8 with console.log(double(4))
Another feature of the arrow function is its shorthand syntax. Simple functions that take in an argument and immediately produce a result like the one above can use this shorthand form in order to be cleaner and more concise.

In this case, the curly braces and the return keyword are not necessary.
This shorthand syntax is used for simple rather than complex functions. For example, an if-statement would require the longer form of the arrow function.
Arrow functions are not a good choice when its comes to methods. That is, when they are used as properties on an object when we want to access “this”. For example “this.name” in the below examples. Arrow functions do not bind their own “this” value.
ES5 format:

team.printTeamMembers()
We can, however, use an ES6 shorthand method syntax in this case:

Hope that’s helpful! Happy coding 🙂
npm (Node Package Manager) is on online repository used by Node.js developers. It contains multitudes of libraries of pre-packaged code that are used by millions of people across various applications. Much of it is free and open-source.
Usually you will use an npm package for something that is not unique to your app, meaning – there’s no need to reinvent the wheel. These could include things like email validation, a UI library like React or a debugging tool.
You can install both local and global dependencies:
Local packages are installed directly on your app in the node modules directory and are listed in the package.json file. They can be installed on your project with a simple npm install command. In order to make use of a local package in a particular code file, you will need to include require(‘package-name’).
When you install a package globally you don’t install it directly into your source files, but rather in a single place on your system so that it can be re-used across various applications. This can be done with an npm install -g command. Globally installed packages give access to a new command in the terminal and should really only be used for packages that you intend to utilize across a number of projects. For instance, the nodemon package will allow you to automatically restart your app whenever the code is updated. This is potentially helpful across a whole range of apps.
Do you have any favorite npm packages?
Since I’m refreshing (I’ve done a little before) and learning new material in Node, I thought I’d make a few posts covering the basics. For anyone interested, I’m finding Andrew Mead’s Complete Node.js Developer on Udemy very helpful so far!
First up, what is Node.js?
Node.js a JavaScript runtime environment which allows your JavaScript code to run outside of the web browser (the client side of things) and on the server and command line side of things. It runs on Chrome’s V8 JavaScript engine.
It is non-blocking which means that initiating one data request will not block another from starting, i.e., it’s faster!
It makes use of a call-stack. Every time a new method in your program is called, the “call-stack” will get that new value added on top of it. Each part of the call-stack is like an element in the history of our program. When each function has been completed, it is no longer needed and it is “popped-off” the stack or the program history.
Node has an event queue. As we know, methods are added to the call stack as we go through our program. If one of those methods has to be called at a specific time, for example, that method can be pushed onto the event queue while allowing the remaining code to continue running. Once JS has gone through the program it will check the event queue to see if there’s anything left over to run.
Hope that’s helpful! Do you have any good Node.js tips?
Here a couple of other useful resources 🙂
https://www.freecodecamp.org/news/what-exactly-is-node-js-ae36e97449f5/