ibm / max-toxic-comment-classifier Goto Github PK
View Code? Open in Web Editor NEWDetect 6 types of toxicity in user comments.
Home Page: https://developer.ibm.com/exchanges/models/all/max-toxic-comment-classifier/
License: Apache License 2.0
Detect 6 types of toxicity in user comments.
Home Page: https://developer.ibm.com/exchanges/models/all/max-toxic-comment-classifier/
License: Apache License 2.0
MAX-Toxic-Comment-Classifier/config.py
Line 11 in 25c7aea
Should be 1.0.1
- please remember to bump the version in config.py
before cutting a new release!
Following new convention to separate model assets from sample assets (e.g. images, text, ...)
Is it possible to simplify the result data structure?
For example
{
"text": [
"Mary had a little lamb"
]
}
returns
{
"status": "ok",
"predictions": [
[
{
"toxic": 0.0014839612413197756,
"severe_toxic": 0.00009525173663860187,
"obscene": 0.0003549971734173596,
"threat": 0.00007228714093798772,
"insult": 0.00022114443709142506,
"identity_hate": 0.00010927908442681655
}
]
]
}
Note that the prediction returns a list of lists of dicts, whereas it should be sufficient to return a list of dicts.
{
"status": "ok",
"predictions": [
{
"toxic": 0.0014839612413197756,
"severe_toxic": 0.00009525173663860187,
"obscene": 0.0003549971734173596,
"threat": 0.00007228714093798772,
"insult": 0.00022114443709142506,
"identity_hate": 0.00010927908442681655
}
]
}
Not sure which input would return a multi-dimensional response. The simplified version can accommodate multiple inputs:
{
"text": [
"Mary had a little lamb",
"Little lamb, little lamb,"
]
}
would return
{
"status": "ok",
"predictions": [
{
"toxic": 0.0014839619398117065,
"severe_toxic": 0.0000952516493271105,
"obscene": 0.00035499755176715553,
"threat": 0.00007228707545436919,
"insult": 0.00022114443709142506,
"identity_hate": 0.00010927919356618077
},
{
"toxic": 0.1212717592716217,
"severe_toxic": 0.00012042735033901408,
"obscene": 0.0017211131053045392,
"threat": 0.00017663949984125793,
"insult": 0.0008766597020439804,
"identity_hate": 0.00014419591752812266
}
]
}
with predictions[0]
returning the eval for the first string, .... second string.
What am I missing?
https://github.com/IBM/MAX-Toxic-Comment-Classifier/blob/master/Dockerfile#L1 to take advantage of the CORS bug fix.
Similar to https://github.com/IBM/MAX-Object-Detector/blob/master/demo.ipynb, which illustrates how to invoke the prediction endpoint and parse the results. (~ "notebook-based" swagger spec for a data scientist audience)
Compare the example JSON response in the markdown and the response in the screen captures. They are different.
No big deal, but
{
"text": [""]
}
it's odd that nothing can be interpreted as something
{
"toxic": 0.0015665121609345078,
"severe_toxic": 0.00011611604713834822,
"obscene": 0.0004790136299561709,
"threat": 0.00007217624806798995,
"insult": 0.0003883792378474027,
"identity_hate": 0.0003294776252005249
}
and similarly a meaningless combination of characters
{
"text": ["khdcuc4wcc5jlcnw"]
}
and numbers
{
"text": ["123"]
}
Note sure if there's something that can be done to eliminate noise that's a result of garbage input.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.