Skip to content

Commit

Permalink
use SUSPICIOUS_PROBABILITY_THRESHOLD instead of 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
lgessler committed Jun 15, 2022
1 parent 7aec612 commit de40ac9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/js/new_segmenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function Document(props) {
const tokens = props.tokens.filter(t => t["token-type"] !== "super");
const firstToken = tokens && tokens.length > 0 && tokens[0]
const outProb = firstToken && firstToken.probas && firstToken.probas.O
const maybeMerge = outProb && outProb > 0.9
const maybeMerge = outProb && outProb > SUSPICIOUS_PROBABILITY_THRESHOLD
const isGold = firstToken.quality && firstToken.quality === "gold"
if (!isGold && maybeMerge) {
className += " sentence-maybe-merge"
Expand Down
2 changes: 1 addition & 1 deletion src/js/segmenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function parse_input(conllu) {
// setting spacer shape and color
if (split_just_seen) {
space = "✗";
if (probas_num < 0.9) {
if (probas_num < SUSPICIOUS_PROBABILITY_THRESHOLD) {
testclass = "red";
} else{
testclass = "gray";
Expand Down
5 changes: 2 additions & 3 deletions src/ud-tree/ud-tree/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,12 @@ function computeEdge (key, x, y, dx, dy, maxHeight, color, highlighted=false) {
// Data/API helpers
//////////////////////////////////////////////////////////////////////////////////
// active learning functions for determiniting which annotations should be highlighted
const SUSPICIOUS_CUTOFF = 0.9
function isHeadSuspicious(head) {
return head.quality !== "gold" && head.probas && head.probas[head.value] < SUSPICIOUS_CUTOFF;
return head.quality !== "gold" && head.probas && head.probas[head.value] < SUSPICIOUS_PROBABILITY_THRESHOLD;
}

function isXposSuspicious(xpos) {
return xpos.quality !== "gold" && xpos.probas && xpos.probas[xpos.value] < SUSPICIOUS_CUTOFF;
return xpos.quality !== "gold" && xpos.probas && xpos.probas[xpos.value] < SUSPICIOUS_PROBABILITY_THRESHOLD;
}

async function updateHead(id, head){
Expand Down
1 change: 1 addition & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ module.exports = {
plugins: [
new webpack.DefinePlugin({
API_ENDPOINT: JSON.stringify("http://localhost:3000/api"),
SUSPICIOUS_PROBABILITY_THRESHOLD: 0.9,
}),
new HtmlWebpackPlugin({
template: './src/page-document/tmpl.html',
Expand Down
1 change: 1 addition & 0 deletions webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ module.exports = {
plugins: [
new webpack.DefinePlugin({
API_ENDPOINT: JSON.stringify("http://localhost:3000/api"),
SUSPICIOUS_PROBABILITY_THRESHOLD: 0.9,
}),
new HtmlWebpackPlugin({
template: './src/page-document/tmpl.html',
Expand Down

0 comments on commit de40ac9

Please sign in to comment.