Context Is Everything: Finding Meaning Statistically in Semantic Spaces
arxiv.org
arxiv.org
TL;DR:
1. Build a special distance(word1, word2) metric using a set of word vectors trained elsewhere (such as GloVe). This distance works better than cosine distance.
2. Given a document (a sentence, a paragraph… basically, a sequence of words), calculate the "importance" of each word as a sigmoid over distances(word, avg(all_words)).
3. To embed a document, simply do a weighted average of its word vectors, where the weight of each word equals the importance above.
(disclaimer: i dr)
https://github.com/ransomw/botiful-soup/blob/master/mibot/sr...
as i recall, there's a lot of neato REPL-y graphvis to try in
https://github.com/ransomw/botiful-soup/tree/master/mibot/de...
----
while i'm here, let me mention: Gärdenfors books like "Geometry of Meaning" are hearty food for thought about natural language semantics
(In practice, this can also be applied outside of language, for the importance of other semantic vectors in context)
Apologies if all of this is blindingly obvious. I’m a fascinated amateur.
[1] https://en.m.wikipedia.org/wiki/List_of_cognitive_biases
I'd recommend starting by trying to detect the presence of the bias first. Language generation is a very difficult problem in general and this is an especially difficult instance of it. Even detecting bias will be challenging because of how subtle a phenomenon it is, but it's much more tractable than rewriting what was said to not include the detected bias.