mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 23:21:47 +08:00
5173af2a27
* updated readme * added config var TALK_PERSPECTIVE_MODEL * fixed duplication on readme * fixed link on readme * fix: applied some changes
16 lines
432 B
JavaScript
16 lines
432 B
JavaScript
const get = require('lodash/get');
|
|
const { API_MODEL } = require('./config');
|
|
|
|
module.exports = {
|
|
Comment: {
|
|
toxicity: comment =>
|
|
// Try to get the score from the custom model first, but fall back to the
|
|
// TOXICITY score if it isn't provided.
|
|
get(
|
|
comment,
|
|
`metadata.perspective.${API_MODEL}.summaryScore`,
|
|
get(comment, 'metadata.perspective.TOXICITY.summaryScore')
|
|
),
|
|
},
|
|
};
|