One of the projects I'm working on is quantifying how abstract concepts like "freedom" or "business" differ between cultures using the property listing task (PLT) of cognitive psychology. An important part of that is being able to compute the similarity between two words. For example, we would expect the similarity between "dog" and "cat" to be higher than the similarity between "dog" and "atom". People in the field of natural language processing (NLP) have been working on this problem for years. Recently, with the rise of AI, some very good tools for this have emerged. In general, these tools are called "transformers". They turn words and phrases into points in space. Once they're in space, you can see how close together or far apart they are. Today I spent the day reading about these transformers and playing around with them.
The transformer I used today is only about 1.5 years old--so pretty new. What's interesting about this transformer is that it has been trained on over 100 currently living languages. So, no only will it say how similar "dog" and "cat" are, but how similar "perro" and "gato" are. Even better, it will say how similar "dog" and "gato" are, or "perro" and "cat".
Here's a multilingual set of words and the similarity scores. In the (dog, dog) slot we have a 1.0, which is perfectly similar. In the (dog, perro) slot, we see 0.822, not perfect.
| dog | perro | cat | gato | cow | vaca | |
|---|---|---|---|---|---|---|
| dog | 1.000000 | 0.822781 | 0.648068 | 0.653384 | 0.643983 | 0.492068 |
| perro | 0.822781 | 1.000000 | 0.621134 | 0.639385 | 0.632134 | 0.499414 |
| cat | 0.648068 | 0.621134 | 1.000000 | 0.790680 | 0.589765 | 0.444248 |
| gato | 0.653384 | 0.639385 | 0.790680 | 1.000000 | 0.582464 | 0.510511 |
| cow | 0.643983 | 0.632134 | 0.589765 | 0.582464 | 1.000000 | 0.504098 |
| vaca | 0.492068 | 0.499414 | 0.444248 | 0.510511 | 0.504098 | 1.000000 |


No comments:
Post a Comment