A Different Approach to Text Moderation

Tisane has been around for half a decade. It stands apart from other text moderation tools with its architecture. We were shy about our unorthodox approach in our early years; now we have enough traction and confidence to come out.

Bird’s-eye View

Today, most text moderation APIs are either machine learning classifiers or rule-based engines looking for keywords. Tisane is neither.

Under the hood, Tisane is a sense disambiguation platform. It receives text as its input, and produces a knowledge graph. The nodes of the knowledge graph contain word senses rather than words; that is, a combination of a lexical item and its interpretation in the current context.

Then, labels are generated based on the combination of graph node constraints. These labels can be anything: entity types, sentiment values, or alerts about problematic content. Think of it as spaCy-like multipurpose engine, but based on a monolithic, interpretable architecture.

But Why?

tl;dr Because the mainstream solutions are broken in too many ways to count.

The simple keyword or blocklist-based solutions (aka clbuttic) may work for simple tasks in low-traffic communities but will make managing anything bigger or more complex a living hell. (Embrace your inner adolescent and read more with examples.) Most importantly, the bulk of issues do not involve “bad words” but “bad combinations” of neutral words.

Which is why machine learning solutions took over in late 2010s, with the promise of a more nuanced and context-aware solution. While the new paradigm did provide new ways of catching unwanted content, it also created additional issues. Perhaps, the biggest one is adding to the exponentially growing antagonism toward social networks. With the approach often falling back to a bag of words, utterances like “I am a black sex worker” may be perceived as racist. Tweaking and balancing would improve the accuracy somewhat, but not the trust of users whose messages were blacklisted with no explanation.

Computer says no. Puzzled human is trying to understand why. (Image by redgreystock on Freepik)

It is expensive and difficult enough to develop ML classifiers for the major languages. But the trickle-down economics for languages with less data worked even worse. Suffice to say that even juggernauts like Facebook did not deploy a classifier for a language with as many speakers as Hindi as late as in 2021.

But that’s not all.

Transparency, Transparency, Transparency

Just a few days ago the former Google Safety Lead, Arjun Narayan, named the black box aspect of AI one of its biggest issues. It’s hardly new or controversial. When in late 2022 Silicon Valley investor Sriram Krishnan spoke about his transparent moderation proposal, Mark Cuban countered that the roadblock is AI being black box and “hard to audit”:

Opaqueness, as we know, is baked in machine learning. The best explanation ML can give is pinpointing the nodes that influenced its decision. The rest is untraceable, a bajillion-dimensioned matrix multiplied by another bajillion-dimensioned matrix.

73% Likelihood of Naughty

If Kafka were writing his Der Process today, he would absolutely feature an equivalent of confidence values. Because being judged by a black box is not scary enough. It has to be a combination of a black box and dice.

The whole idea of pigeonholing human behavior into “naughty” and “nice” may be suitable for Santa Claus, but trust & safety people need to do better than that. And only a sadist Santa Claus would combine his own judgement with a roll of a dice. “Well, it’s 73% confidence value… yeah, probably naughty. If it were 72.98%, then the elves from Mechanical Turk had to take another look.”

We saw customers who hinge their entire moderation process on the confidence values; with both their classifiers and human moderators tending to err on the side of “guilty” (as a character in another Kafka’s story would put it, “guilt is never to be doubted”), the posters had to adapt their habits in a textbook example of leaky abstraction. They would obfuscate words like “fascist”, follow up with puzzled posts asking why they were banned after pointing out racism, and get banned again.

Industry leaders like Grindr’s Alice Goguen Hunsberger say that it’s not uncommon for an ML model to have high confidence but be wrong, and the human moderators must not be swayed by it.

That sounds like (pardon the pun) a lack of confidence in confidence values to me, and Alice is far from being alone in it.

The confidence value is then a security theater, introducing dangers like automation bias. In the perfect world, human moderators are PhDs in ethics debating big philosophical questions; in the real world, they are underpaid students strongly encouraged to perform their tasks as fast as possible. “Computer says no” more often than not means the human moderators will say no, too.

Not a Nail, Abandon Hammer

Clearly, finding arbitrarily defined “nasties” in text is more than just a “classification task”. A proper platform used to punish and ban people needs to have the decency to explain itself. It needs to adapt to the ever-changing and ever-expanding needs. It needs to make do with little to no training data. And it needs to be serviceable and updateable without the need to retrain huge models, wasting resources and risking regressions.

In other words, a black box paradigm is a poor fit for text moderation engines. Not to mention that the logic of a giant switch case statement is a bad fit for curve fitting in general.

Yes, trust & safety people found ways to adapt to the deficiencies of the current black box engines. But look around you. The discontent is everywhere, regardless of the political and social views. And even top tier communities like Twitter still fall back to keyword-based decision flow. Laws are being drafted to change the situation and right the perceived wrongs. World authorities in trust & safety talk about the tools being inadequate for their needs. While the objections target the process in general, the shaky technological base is at the heart of the issue.

What is Tisane, Anyway?

“You say ML is a bad fit and keywords are inadequate. What did you build then?”

Tisane is a knowledge graph solution, but much more granular than most its peers. Architecturally, it can be viewed as a symbolic counterpart of seq2seq. Our language models contain a rich set of morphological, syntactic, and semantic features, merged from a variety of sources. Because the runtime is symbolic and interpretable, we have full control over the flow, and can introduce new device at any stage.

Of course, building this kind of engine together with proprietary language models for it is easier said that done. If you’re a bit older, you may be familiar with mostly aborted attempts to build this kind of a multipurpose contraptions. As anyone familiar with this architecture will tell you, it’s basically a hoop-jumping marathon with contestants dropping like flies. What only 5% of those who tried building it will tell you is that once you’re done with the Shawshank Redemption-style sewer crawl, things become much easier, and adding new features that take ages with other engines gets trivial.

So what did we get with our off-the-beaten-track approach?

Algorithmic Transparency

The primary requirements are:

  • highlight the actual issue
  • tell why you think it’s an issue

Tisane both pinpoints the problematic fragment and, optionally, provides a human-readable explanation why it thinks the fragment is problematic.

Example output with an explanation

How is it possible? Much like other parts of the language building process, Tisane design workflow utilizes a combination of automated techniques and expert input with a highly efficient formalism. (The runtime is symbolic, but the designer platform is a literal smorgasbord!) In the example above, the “unwelcome person” may be any kind of unwelcome person, be it “liar”, “cheater”, “thief”, “coward”, etc. The query is on the specific nodes in the parse tree; meaning, it can also be interspersed with stray nouns, adverbs, and more (assuming the sentence is making grammatical sense or close to it, of course). The queries are across languages; as one such query covers thousands of combinations in one language, multiply it by the number of supported languages for the total coverage. Queries can be quite specific and convoluted, like tweezers for data extraction.

With Tisane, a human moderator does not need to scan a huge wall of text and scratch their head trying to figure out why “computer says no”. Tisane provides the reasoning behind its decisions, according to the requirements of EU Digital Services Act and other frameworks. The moderator job then is reduced to a sanity check, rather than trying to figure out alien logic while acting as a judge and an executioner. If Tisane messed up, it’s not going to cover its tracks; it’ll make it obvious.

If it isn’t enough, and the language model designer wants to drill down into the parsing process, there is a special web-based debugger which replays the process step by step and generates debugging info for the structures involved.

Embedded debugger for Tisane

Flexibility and Maintenance: Not Like a Box of Chocolates

It is well known that 60% of software life cycle costs come from maintenance. With the black box ML engines, the need to retrain the entire model every time pushes the costs even higher. Retraining a model in an attempt to eliminate a flaw may introduce regressions, with the consistency difficult or even impossible to control. A bit like the Forrest Gump’s box of chocolates, but of the kind nobody wants.

In contrast, Tisane’s processing flow is predictable. That is not to say that regressions are impossible; it is software, after all. But all conflicts can be tracked and ultimately resolved. Generating a language model from the design tables (“compilation”, as we call it) takes minutes on a very standard machine without GPUs (or seconds for the metadata).

Granularity

When everything is structured, adding more features to the word sense nodes becomes trivial. For example, with hate speech, most engines already moved to tag that it’s hate speech (rather than a generic “toxicity” label from mid-2010s). Tisane takes it one step further and also adds the sub-type of bigotry (e.g. Islamophobia, homophobia, xenophobia, etc.).

How did it come into being? A customer asked whether it’s possible, and it took a couple of hours to map the root nodes; the rest was propagated automatically.

The requirements multiply faster than anyone expects, and so new features are not added just for the heck of it. We don’t have to build a new model every time, just add a couple of features to the model.

Cloud Providers Hate Him

Over its analysis, Tisane plays numerous what-ifs and is far more resource intensive than a simple syntactic parser or a part of speech tagger; in fact, these tasks are included in the analysis process. But it doesn’t come close to the CPU and RAM consumption of machine learning moderation engines.

Tisane runtime is built on cross-platform POSIX C++, with native editions for Linux, Windows, and maybe other OSes in the future. It is small enough to be deployed on device, and some of our customers do just that.

Last but not least, Tisane is an energy efficient C++ application, with C++ consistently rated as one of the most energy efficient programming languages. And while it may be disappointing for AWS, Azure, and Nvidia, we know that we contribute way fewer carbon emissions than our energy-hungry peers, and save a lot of hosting expenses for our on-prem customers and ourselves.

Language Trickle-Down Economics

Tisane’s language model design module is built to combine input from different sources: fuzzy matching, guided import, and manual expert input. (Plus generative AI, see closer to the end.) While we can use them for benchmarking, we do not require tagged datasets to learn from; we may utilize sources like Wikidata (as a starting point), augmenting them with expert input in more ambiguous cases.

This opens vast opportunities when tackling niche and low-data languages. A training set does not have to come in one package or (again) a black box. We don’t have to wait decades until enough data “trickles down”.

Multistep Detection

While for most trust & safety tasks the logic can be found in one sentence, or maybe in another one just before it, some cases are more complex.

Consider the following utterance: “Where are your parents now?” On its own, we don’t have enough context to mark it as problematic. It can be anything: two kids talking about their parents or a repairman trying to locate the head of the household. Then consider another utterance: “Can you turn on your camera?” Once again, the utterance alone does not necessarily imply nefarious intent. It may be from a conversation between colleagues at work. However, when the request to turn on the camera follows the inquiry about the location of the parents, it makes a lot of sense to issue an alert.

Example how Tisane handles multistep detection

Tisane makes use of flags that can be set externally or internally to accumulate pieces of evidence when several signals are required.

Specific Context: Treachery of Games

The same flag mechanism also helps to reduce false positives. For example, in gaming chats, or chats discussing competitions, “Shoot him!” or “We’re gonna kick your a*” are perfectly acceptable and are not indicators of ill intent.

Tisane has a special flag to prevent “competitive language” from triggering alerts, and a mechanism to parse coded language.

Future Proof

When ChatGPT made everyone pay attention to generative AI, we were taken aback like many others, and even worried. But that didn’t last long.

The separation into the design platform and the runtime allows plugging whatever future technologies may emerge into the design platform, which still produces the same format, but with more accurate extraction and more new features.

For example, we’re using generative AI to suggest changes to our knowledge graphs and correct anomalies.

Invoking generative AI to fill in the blanks in the linguistic database

In a way, we’re creating a combination of an “LLM snapshot” and manual adjustments, while enjoying the best of both worlds: deterministic, efficient Tisane and coverage of edge cases that the original Tisane language models may have been lacking. It is also possible that Tisane can be used as a “Trojan horse” to get some generative AI functionality to the enterprise.

Conclusion

We’re no longer asked whether this kind of architecture is viable, or whether it’s more fragile. We have proven it’s viable, robust, and, most importantly, solves nagging issues that other paradigms don’t.

Can a traversable deterministic graph of entities offer unique advantages beyond trust & safety? Tisane is already actively used in law enforcement and national security, where determinism, explainability, and data economics are essential. We are open to other future applications, too.

Have any questions or comments about the topic discussed in this post? Feel free to comment or contact us and we’ll be happy to help!

Tisane Bot Added to Slack App Directory

After a thorough review, Tisane Bot for Slack has been approved. It is now listed in Slack App Directory.

Tisane Bot for Slack is an easy to use moderation aid for Slack communities great and small. Monitor your Slack channels for cyberbullying, insults, data leaks, hate speech, and other HR policy violations. The bot is easy to install and does not require IT expertise.

Tisane Bot comes with all the capabilities Tisane API has to offer:

  • 30 languages are supported
  • detailed explanation why the post was flagged
  • reduces moderator chores by 95%
  • for non-English posts, automatic translation is provided
  • on-prem installation is available

Read more about Tisane Bot for Slack

Read more about detection of abuse with Tisane

Tisane Bot for Slack - Easy moderation for Slack communities | Product Hunt

Darjeeling Update: Codewords, Multi-step Detection, Automatic Language Detection, and More

Darjeeling is the name of our 2021 Tisane update. While we worked on multiple parts of the system, the focus in this update is on moving beyond the “sliding window” of one sentence. The current edition adds powerful tools to make the system aware of non-textual content, as well as context coming from different messages.

See below short notes on the new features and changes.

Automatic Language Detection

For those working with multiple languages, it is now possible to use the automatic language detection. In addition to the new method, it can be activated in other methods as well; simply specify * as the language code value. If the likely languages are known, specify them the vertical bar-delimited list of the likely language codes, e.g. en|es|ja.

More Subtypes for Abuse

We added more tags to describe the various shades of abuse. In the instances of hate speech (bigotry type), we now detect the protected class being targeted, generating tags like racism, xenophobia, sexism, religion, and more.

Runtime Redefinition: Codewords & More

Redefining concepts & features on the fly became possible thanks to the brand new Long-Term Memory module. From conversations with the law enforcement users, we learned that codewords are a persistent challenge that subverts detection efforts. Tisane now allows redefining what concepts mean; not just adding word for word, but redefining entire families or even categories.

E.g. if someone consistently means spies when mentioning any types of mushrooms (be it champignons, chanterelles, etc.), there is a new structure in the settings that allows redefining it. Upon learning of the hidden meanings, the users then can request the service to interpret some concepts differently, reprocess the text, and detect patterns that were skipped. Contact us to learn more.

The redefinition module allows redefining both meanings and features. For example, we can define that the gender of the speaker or the interlocutor for languages where these pronouns do not have gender, generating translations with the correct gender. We can assign new categories, reflecting subjective opinions (e.g. link a particular political faction to the concept of “unwelcome person” to gauge sentiment). The runtime redefinitions will then work in concert with the pre-built language models.

Nontextual Context Flags

Another use of the Long-Term Memory module is to define non-textual context. For example, if a meme shows a pile of refuse or an animal associated with negative qualities (ape, pig, snake) and the text overlay names a protected class, the text in itself is not offensive. However, the message is undoubtedly is. It is now possible to set a flag for particular types of situations. These flags will provide context, allowing Tisane to detect more.

Multi-step Detection

For the subtle and gradual kind of abuse, the picture is never clear from just one sentence. The offender may require multiple steps to gain confidence of the victim, or spin a long story, each part of which is neutral in isolation.

We now allow issuing alerts only when several flags fire. While Tisane remains stateless, it is possible to port the context and the accumulated knowledge from the previous messages in the conversation to the subsequent messages.

Quickwork Releases Tisane Slack Plug-in

Our partners at Quickwork, a platform that allows building any workflow automation in minutes, integrated Tisane API .

Tisane can now be linked to thousands of applications and APIs using Quickwork’s simple and powerful UI, no coding skills required. For example, use Quickwork’s moderation plug-in for Slack using Tisane. See the video of the Slack plug-in in action here.

Quickwork is an enterprise-grade, ISO 27001 and GDPR compliant, no code, API-based, SaaS platform with an extensive range of pre-integrated business- and consumer- apps to solve various automation problems. It offers three key capabilities – Integration, API Management & Conversation Management as a Service. This platform’s Real-time messaging & API based architecture makes it easier to build on these capabilities to offer better workflow solutions and customer experience.

Tisane Labs’ Solutions on Microsoft Azure Add Wikidata Extraction Feature

Published on Marketwatch and Yahoo! Finance

Wikimedia-Azure

SINGAPORE, Oct. 13, 2020 /PRNewswire/ — Tisane Labs, a supplier of text analytics AI solutions, today announced a new feature in Tisane API, already available on Microsoft Azure Marketplace and AppSource. With the new feature, Tisane API now allows tagging and extraction of Wikidata entities, complementing the capabilities provided by Azure Cognitive Services and supporting nearly 30 languages.

“Wikidata allows utilizing Wikipedia knowledge in ways never explored before, but there’re not many ways to get Wikidata references from unstructured text,” said Vadim Berman”Now, with the new feature of Tisane API built on Azure, our users can easily obtain Wikidata IDs from Tisane’s JSON response. Imagine being able to annotate text with images, GPS coordinates, important dates, 3rd party references, and whatever the ever-growing and open Wikidata database contains.”

“Microsoft Azure Marketplace and AppSource lets customers worldwide discover, try, and deploy software solutions that are certified and optimized to run on Azure,” said Sajan Parihar, Senior Director, Microsoft Azure Platform at Microsoft Corp. “Azure Marketplace and AppSource helps solutions like Tisane API reach more customers and markets.”

Tisane API runs in the cloud utilizing Azure API Management, with a simple REST interface that can be linked from any popular programming platform today. Tisane Labs provides a range of tailored plans for its clients with the option of a custom installation on-premises and a free plan.

To try Tisane API, visit https://tisane.ai.

For more information, email press@tisane.ai.

Chai Update: Explainability, Name Validation, New Entities & Formats, Wikidata

The next update after Boldo has to start with C, and so it’s Chai this time (no, corona does not qualify).

It has been a busy year. With more users and new use cases come more feature requests, and we worked hard to implement them.

Explainability

In the moderation space, it helps to provide a cue why the system classified a message as problematic. Human moderators are often stressed, overworked, and overwhelmed, while natural language processing is bound not to be 100% error-free. Reducing their task to a simple “sanity check” whether the system understood the utterance makes them more productive and more consistent. When the explain setting is set to true, Tisane provides a short snippet describing the reasoning (settings: read more here).

JSON response including an explanation
Pinpointing problematic content

Name Parsing & Validation

Many communities require users to enter real names. Some users prefer not to, for different reasons. In some cases, there is a need to break down a full name into constituents, such as given name, surname, middle name, etc.

Tisane now provides methods to:

  • parse names into constituents, extracting the components
  • validate names, tagging names of important people, spiritual beings, and fictional characters. No more Boba Fett or Satan as a real name!
  • compare names in the same or different languages, producing a list of differences
JSON response recognizing a name as that of an 'important person'
JSON response recognizing a name as that of an “important person”

Read more about name-related methods.

Wikidata Everywhere

Wikidata IDs are now supported at the level of entities, topics, and even some non-entity words.

Imagine deducing geographic coordinates, Britannica article ID, or semantic properties from text that went through Tisane!

New Formats, Entity Types, Abuse Types

Different content formats may have different logic tied to them, especially when the context is lacking. With new requirements, we added two new formats:

  • search to screen search queries
  • alias to screen user names in online communities
Example of search query screening

With more law enforcement vendors adopting Tisane, we were asked to add entity types of interest to the law enforcement, specifically:

  • weight
  • bank_account 
  • credit_card, including subtypes representing the major credit card types
  • credential, with optional subtypes md5 and sha-1
  • crypto for major cryptocurrency addresses

and more. See all the types here.

We also added two more types to tag problematic content:

  • adult_only, for activities allowed in adult communities but restricted for minors (e.g. consuming alcohol)
  • mental_issues, for signs of depression and suicidal thoughts

Miscellaneous

As always, we keep honing and enhancing our language models, as well as throughput and stability of Tisane.

New Features: Boldo Update

Photo by Praveen (CC BY 2.0)

Following the requests of our users, we implemented additional features. They are now active; feel free to kick the tires. (And yes, our updates are named after herbal teas.)

Detecting Attempts to Establish External Contact

In some communities, external contacts must be monitored. Marketplaces, communities with some kind of harassment issues, scammers attempting to lure users out, and so on. As of today, a common simple solution is to scan messages using regular expressions and find phone numbers and emails. That, however, is insufficient, as the users often find ways to bypass these checks, or introduce non-standard formatting.

We now detect these attempts and place the detected snippets with the external_contact type. For example, a request to provide an email, a WhatsApp number, and so on (“we need your email”, “wat is ur whats app”, etc.).

Signal to Noise Ranking

If you need to create a summary or write a report about how a particular topic or brand is reflected in the social media, the sheer amount of posts that need to be processed is often overwhelming. What’s worse, 95% of these are not much help. They either copy other people’s thoughts, are completely off-topic, contain all kinds of abuse, or just vent frustration and negative emotions. Same goes for the comments: with a few pearls, many are just background noise.

The signal to noise ratio is not unlike conventional search engine rankings, but better adapted for the social media content needs.

The ranking prioritises posts related to the specified concepts and domains, and penalises off-topic content and abuse.

In order to compute the signal to noise ranking, provide an array of concept IDs (family IDs) in your settings under the relevant attribute (e.g. “relevant”: [12345,6789]).

Native Topic Standard Overhaul

While we support taxonomy standards like IPTC and IAB, our internal taxonomy is much richer. The topics that don’t appear in IPTC and IAB can be exposed using the native topic mode (code: native). Previously, it was used for internal purposes only, and contained numeric codes.

After this update, they contain English descriptions, and the taxonomy was also expanded.

Topic Optimization

Some of the topics may overlap. “Compound” topics like cryptocurrency may imply other topics like finance and software. Depending on your application, you may or may not need these “constituent” topics.

The optimize_topics parameter allows control over how it’s presented. For example, when analyzing a sentence like “exchange btc to xmr”, and the optimize_topics is set to false, we get:

  {
    "text": "exchange btc to xmr",
    "topics": [
       "money",
       "commerce",
       "business",
       "finance",
       "software",
       "currency",
       "cryptocurrency"
    ]
  }

When the parameter is set to true, we get:

  {
    "text": "exchange btc to xmr",
    "topics": [
       "cryptocurrency"
    ]
  }

Format-Sensitive Logic

We had to learn the hard way that it matters where the text is coming from.

A simple example. A single word like “fool” may be a title, in which case it bears a negative connotation, but not a personal attack. However, when posted as a part of a dialogue (e.g. in a comment in Instagram), it is a personal attack.

We introduced support of different logic for different formats.

Feature Default Format Changed to Universal Dependencies

Tisane supports several standards to display grammar features, such as Penn, Universal Dependencies, Glossing Abbreviations, and the native codes and descriptions. We saw that the original glossing abbreviation format was confusing for many users, and changed the default to Universal Dependencies.

If you prefer to do so, you can still use “glossing” to obtain glossing abbreviations.

Document-Level Sentiment

While we stress that the aspect-based sentiment analysis provides more actionable intelligence, we added a document-level attribute for certain scenarios. Add “document_sentiment”:true to the settings to obtain the document-level sentiment value in range -1 (most negative) thru 1 (most positive). It will be placed in the sentiment attribute.

Contact us for questions and more information. If you are new to Tisane, please sign up here, it’s free.