Tigran Tokmajyan commited on
Commit ·
b6d576a
1
Parent(s): 38356e3
Add widget stuff
Browse files- config.json +9 -1
- widget.html +37 -0
config.json
CHANGED
|
@@ -27,5 +27,13 @@
|
|
| 27 |
"type_vocab_size": 1,
|
| 28 |
"use_cache": true,
|
| 29 |
"vocab_size": 50267,
|
| 30 |
-
"xpath_unit_hidden_size": 32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
}
|
|
|
|
| 27 |
"type_vocab_size": 1,
|
| 28 |
"use_cache": true,
|
| 29 |
"vocab_size": 50267,
|
| 30 |
+
"xpath_unit_hidden_size": 32,
|
| 31 |
+
"widget": {
|
| 32 |
+
"examples": [
|
| 33 |
+
{
|
| 34 |
+
"html": "<html><body><h1>What is MarkupLM?</h1><p>MarkupLM is a model for understanding structured documents.</p></body></html>",
|
| 35 |
+
"question": "What is MarkupLM?"
|
| 36 |
+
}
|
| 37 |
+
]
|
| 38 |
+
}
|
| 39 |
}
|
widget.html
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div>
|
| 2 |
+
<div class="form-group">
|
| 3 |
+
<label>HTML/XML Input</label>
|
| 4 |
+
<textarea
|
| 5 |
+
id="html-input"
|
| 6 |
+
class="form-control"
|
| 7 |
+
rows="10"
|
| 8 |
+
placeholder="Paste your HTML/XML here..."
|
| 9 |
+
></textarea>
|
| 10 |
+
</div>
|
| 11 |
+
|
| 12 |
+
<div class="form-group">
|
| 13 |
+
<label>Question</label>
|
| 14 |
+
<textarea
|
| 15 |
+
id="question-input"
|
| 16 |
+
class="form-control"
|
| 17 |
+
rows="2"
|
| 18 |
+
placeholder="Enter your question..."
|
| 19 |
+
></textarea>
|
| 20 |
+
</div>
|
| 21 |
+
|
| 22 |
+
<script>
|
| 23 |
+
// This function will be called when the user clicks "Compute"
|
| 24 |
+
async function query() {
|
| 25 |
+
const html = document.querySelector("#html-input").value;
|
| 26 |
+
const question = document.querySelector("#question-input").value;
|
| 27 |
+
|
| 28 |
+
// Combine inputs into the JSON format your handler expects
|
| 29 |
+
return {
|
| 30 |
+
inputs: {
|
| 31 |
+
html: html,
|
| 32 |
+
question: question
|
| 33 |
+
}
|
| 34 |
+
};
|
| 35 |
+
}
|
| 36 |
+
</script>
|
| 37 |
+
</div>
|