text-html.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. const config = `
  2. <View>
  3. <HyperTextLabels name="ner" toName="text">
  4. <Label value="Person"></Label>
  5. <Label value="Organization"></Label>
  6. <Label value="Date"></Label>
  7. </HyperTextLabels>
  8. <HyperText name="text" value="$text"></HyperText>
  9. </View>
  10. `;
  11. const data = {
  12. text: '<div style="max-width: 750px"><div style="clear: both"><div style="float: right; display: inline-block; border: 1px solid #F2F3F4; background-color: #F8F9F9; border-radius: 5px; padding: 7px; margin: 10px 0;"><p><b>Jules</b>: No no, Mr. Wolfe, it\'s not like that. Your help is definitely appreciated.</p></div></div><div style="clear: both"><div style="float: right; display: inline-block; border: 1px solid #F2F3F4; background-color: #F8F9F9; border-radius: 5px; padding: 7px; margin: 10px 0;"><p><b>Vincent</b>: Look, Mr. Wolfe, I respect you. I just don\'t like people barking orders at me, that\'s all.</p></div></div><div style="clear: both"><div style="display: inline-block; border: 1px solid #D5F5E3; background-color: #EAFAF1; border-radius: 5px; padding: 7px; margin: 10px 0;"><p><b>The Wolf</b>: If I\'m curt with you, it\'s because time is a factor. I think fast, I talk fast, and I need you two guys to act fast if you want to get out of this. So pretty please, with sugar on top, clean the car.</p></div></div></div>',
  13. };
  14. const result = [
  15. {
  16. id: "Umb_V5CIey",
  17. from_name: "ner",
  18. to_name: "text",
  19. type: "hypertextlabels",
  20. origin: "manual",
  21. value: {
  22. start: "/div[1]/div[2]/div[1]/p[1]/b[1]/text()[1]",
  23. end: "/div[1]/div[2]/div[1]/p[1]/text()[1]",
  24. startOffset: 0,
  25. endOffset: 17,
  26. globalOffsets: {
  27. start: 81,
  28. end: 105,
  29. },
  30. text: "Vincent: Look, Mr. Wolfe",
  31. hypertextlabels: ["Date"],
  32. },
  33. },
  34. {
  35. id: "FQKKGR1yv5",
  36. from_name: "ner",
  37. to_name: "text",
  38. type: "hypertextlabels",
  39. origin: "manual",
  40. value: {
  41. start: "/div[1]/div[1]/div[1]/p[1]/b[1]/text()[1]",
  42. end: "/div[1]/div[1]/div[1]/p[1]/b[1]/text()[1]",
  43. startOffset: 0,
  44. endOffset: 5,
  45. globalOffsets: {
  46. start: 0,
  47. end: 5,
  48. },
  49. text: "Jules",
  50. hypertextlabels: ["Person"],
  51. },
  52. },
  53. {
  54. id: "SLNxK0a8oW",
  55. from_name: "ner",
  56. to_name: "text",
  57. type: "hypertextlabels",
  58. origin: "manual",
  59. value: {
  60. start: "/div[1]/div[3]/div[1]/p[1]/b[1]/text()[1]",
  61. end: "/div[1]/div[3]/div[1]/p[1]/b[1]/text()[1]",
  62. startOffset: 0,
  63. endOffset: 8,
  64. globalOffsets: {
  65. start: 180,
  66. end: 188,
  67. },
  68. text: "The Wolf",
  69. hypertextlabels: ["Person"],
  70. },
  71. },
  72. {
  73. id: "fyHRX3DdNv",
  74. from_name: "ner",
  75. to_name: "text",
  76. type: "hypertextlabels",
  77. origin: "manual",
  78. value: {
  79. start: "/div[1]/div[1]/div[1]/p[1]/text()[1]",
  80. end: "/div[1]/div[2]/div[1]/p[1]/text()[1]",
  81. startOffset: 64,
  82. endOffset: 33,
  83. globalOffsets: {
  84. start: 69,
  85. end: 121,
  86. },
  87. text: "appreciated.\\n\\nVincent: Look, Mr. Wolfe, I respect you.",
  88. hypertextlabels: ["Date"],
  89. },
  90. },
  91. ];
  92. const title = "HTML labeling";
  93. module.exports = { config, data, result, title };