@@ -58,6 +58,10 @@ export default function AssistantTextClassification({
5858 "likely_machine" ,
5959 "highly_likely_machine" ,
6060 ] ,
61+ // news framing
62+ newsFramingConfidenceThreshold : 0.8 ,
63+ // news genre
64+ newsGenreConfidenceThresholdLow : 0.7 ,
6165 } ,
6266 textHtmlMap = null ,
6367 credibilitySignal = "" ,
@@ -97,14 +101,13 @@ export default function AssistantTextClassification({
97101 const mgtOverallScoreLabel = "mgt_overall_score" ;
98102
99103 // define colours
104+ let newsFramingConfidenceThreshold , newsGenreConfidenceThreshold ;
100105 let mgtColours , mgtColoursDark , orderedCategories ;
101106 let subjectivityColours , subjectivityColoursDark ;
102- let confidenceThresholdLow ;
103- if (
104- credibilitySignal === newsFramingTitle ||
105- credibilitySignal === newsGenreTitle
106- ) {
107- confidenceThresholdLow = configs . confidenceThresholdLow ;
107+ if ( credibilitySignal === newsFramingTitle ) {
108+ newsFramingConfidenceThreshold = configs . newsFramingConfidenceThreshold ;
109+ } else if ( credibilitySignal === newsGenreTitle ) {
110+ newsGenreConfidenceThreshold = configs . newsGenreConfidenceThreshold ;
108111 } else if ( credibilitySignal === machineGeneratedTextTitle ) {
109112 [ mgtColours , mgtColoursDark ] = getMgtColours ( configs ) ;
110113 orderedCategories = configs . orderedCategories ;
@@ -149,12 +152,14 @@ export default function AssistantTextClassification({
149152 // set default news genre value if category below threshold
150153 label === REPORTING_LABEL
151154 ? ( filteredCategories [ label ] = classification [ label ] )
152- : classification [ label ] [ 0 ] . score >= confidenceThresholdLow
155+ : classification [ label ] [ 0 ] . score >= newsGenreConfidenceThreshold
153156 ? ( filteredCategories [ label ] = classification [ label ] )
154157 : ( filteredCategories [ REPORTING_LABEL ] = [
155- { indices : [ 0 , - 1 ] , score : confidenceThresholdLow } ,
158+ { indices : [ 0 , - 1 ] , score : newsGenreConfidenceThreshold } ,
156159 ] ) ;
157- } else if ( classification [ label ] [ 0 ] . score >= confidenceThresholdLow ) {
160+ } else if (
161+ classification [ label ] [ 0 ] . score >= newsFramingConfidenceThreshold
162+ ) {
158163 // filter news framing categories above threshold
159164 filteredCategories [ label ] = classification [ label ] ;
160165 }
0 commit comments