Spaces:
Running
Running
Julien Chaumond
commited on
Commit
·
2b6ff0c
1
Parent(s):
50afe7d
Better defaults
Browse files- js-src/zController.ts +10 -3
js-src/zController.ts
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
|
2 |
const ENDPOINT = "https://coref.huggingface.co/coref";
|
3 |
-
const DEFAULT_NLP_TEXT =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
const loading = () => {
|
6 |
document.body.classList.toggle('loading');
|
@@ -47,7 +54,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
47 |
$input.value = queryText;
|
48 |
coref.parse(queryText);
|
49 |
} else {
|
50 |
-
coref.parse(DEFAULT_NLP_TEXT); // Trigger run with default text.
|
51 |
}
|
52 |
}
|
53 |
|
@@ -63,7 +70,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
63 |
evt.preventDefault();
|
64 |
const text = ($input.value.length > 0)
|
65 |
? $input.value
|
66 |
-
: DEFAULT_NLP_TEXT;
|
67 |
updateURL(text);
|
68 |
coref.parse(text);
|
69 |
});
|
|
|
1 |
|
2 |
const ENDPOINT = "https://coref.huggingface.co/coref";
|
3 |
+
const DEFAULT_NLP_TEXT = () => {
|
4 |
+
const items = [
|
5 |
+
`I love my father and my mother. They work hard. She is always nice but he is sometimes rude.`,
|
6 |
+
`My sister is swimming with her classmates. They are not bad, but she is better. I love watching her swim.`,
|
7 |
+
`My mother's name is Sasha, she likes dogs.`
|
8 |
+
];
|
9 |
+
return items[Math.floor(Math.random()*items.length)];
|
10 |
+
}
|
11 |
|
12 |
const loading = () => {
|
13 |
document.body.classList.toggle('loading');
|
|
|
54 |
$input.value = queryText;
|
55 |
coref.parse(queryText);
|
56 |
} else {
|
57 |
+
coref.parse(DEFAULT_NLP_TEXT()); // Trigger run with default text.
|
58 |
}
|
59 |
}
|
60 |
|
|
|
70 |
evt.preventDefault();
|
71 |
const text = ($input.value.length > 0)
|
72 |
? $input.value
|
73 |
+
: DEFAULT_NLP_TEXT();
|
74 |
updateURL(text);
|
75 |
coref.parse(text);
|
76 |
});
|