|
72 | 72 | " ),\n",
|
73 | 73 | ")\n",
|
74 | 74 | "\n",
|
| 75 | + "model = lx.factory.create_model(config)\n", |
| 76 | + "\n", |
75 | 77 | "\n",
|
76 | 78 | "result = lx.extract(\n",
|
| 79 | + " model=model,\n", |
77 | 80 | " text_or_documents=input_text,\n",
|
78 | 81 | " prompt_description=prompt,\n",
|
79 | 82 | " examples=examples,\n",
|
80 |
| - " config=config,\n", |
81 | 83 | " fence_output=False,\n",
|
82 | 84 | " use_schema_constraints=False,\n",
|
83 | 85 | " debug=False,\n",
|
|
199 | 201 | " <div id=\"attributesContainer\"></div>\n",
|
200 | 202 | " </div>\n",
|
201 | 203 | " <div class=\"lx-text-window\" id=\"textWindow\">\n",
|
202 |
| - " <span class=\"lx-highlight lx-current-highlight\" data-idx=\"0\" style=\"background-color:#D2E3FC;\">Lady Juliet</span> <span class=\"lx-highlight\" data-idx=\"1\" style=\"background-color:#C8E6C9;\">gazed longingly</span> at the stars, <span class=\"lx-highlight\" data-idx=\"2\" style=\"background-color:#D2E3FC;\">her heart</span> aching <span class=\"lx-highlight\" data-idx=\"3\" style=\"background-color:#FEF0C3;\">for Romeo</span>\n", |
| 204 | + " <span class=\"lx-highlight lx-current-highlight\" data-idx=\"0\" style=\"background-color:#D2E3FC;\">Lady Juliet</span> <span class=\"lx-highlight\" data-idx=\"1\" style=\"background-color:#C8E6C9;\">gazed longingly</span> at the stars, <span class=\"lx-highlight\" data-idx=\"2\" style=\"background-color:#FEF0C3;\">her heart aching for <span class=\"lx-highlight\" data-idx=\"3\" style=\"background-color:#D2E3FC;\">Romeo</span></span>\n", |
203 | 205 | " </div>\n",
|
204 | 206 | " <div class=\"lx-controls\">\n",
|
205 | 207 | " <div class=\"lx-button-row\">\n",
|
|
221 | 223 | "\n",
|
222 | 224 | "<script>\n",
|
223 | 225 | " (function() {\n",
|
224 |
| - " const extractions = [{\"index\": 0, \"class\": \"character\", \"text\": \"Lady Juliet\", \"color\": \"#D2E3FC\", \"startPos\": 0, \"endPos\": 11, \"beforeText\": \"\", \"extractionText\": \"Lady Juliet\", \"afterText\": \" gazed longingly at the stars, her heart aching for Romeo\", \"attributesHtml\": \"<div><strong>class:</strong> character</div><div><strong>attributes:</strong> {<span class=\\\"lx-attr-key\\\">emotional_state</span>: <span class=\\\"lx-attr-value\\\">longing</span>}</div>\"}, {\"index\": 1, \"class\": \"emotion\", \"text\": \"gazed longingly\", \"color\": \"#C8E6C9\", \"startPos\": 12, \"endPos\": 27, \"beforeText\": \"Lady Juliet \", \"extractionText\": \"gazed longingly\", \"afterText\": \" at the stars, her heart aching for Romeo\", \"attributesHtml\": \"<div><strong>class:</strong> emotion</div><div><strong>attributes:</strong> {<span class=\\\"lx-attr-key\\\">feeling</span>: <span class=\\\"lx-attr-value\\\">intense desire</span>}</div>\"}, {\"index\": 2, \"class\": \"character\", \"text\": \"her heart\", \"color\": \"#D2E3FC\", \"startPos\": 42, \"endPos\": 51, \"beforeText\": \"Lady Juliet gazed longingly at the stars, \", \"extractionText\": \"her heart\", \"afterText\": \" aching for Romeo\", \"attributesHtml\": \"<div><strong>class:</strong> character</div><div><strong>attributes:</strong> {<span class=\\\"lx-attr-key\\\">emotional_state</span>: <span class=\\\"lx-attr-value\\\">aching</span>}</div>\"}, {\"index\": 3, \"class\": \"relationship\", \"text\": \"for Romeo\", \"color\": \"#FEF0C3\", \"startPos\": 59, \"endPos\": 68, \"beforeText\": \"Lady Juliet gazed longingly at the stars, her heart aching \", \"extractionText\": \"for Romeo\", \"afterText\": \"\", \"attributesHtml\": \"<div><strong>class:</strong> relationship</div><div><strong>attributes:</strong> {<span class=\\\"lx-attr-key\\\">type</span>: <span class=\\\"lx-attr-value\\\">affectionate longing</span>}</div>\"}];\n", |
| 226 | + " const extractions = [{\"index\": 0, \"class\": \"character\", \"text\": \"Lady Juliet\", \"color\": \"#D2E3FC\", \"startPos\": 0, \"endPos\": 11, \"beforeText\": \"\", \"extractionText\": \"Lady Juliet\", \"afterText\": \" gazed longingly at the stars, her heart aching for Romeo\", \"attributesHtml\": \"<div><strong>class:</strong> character</div><div><strong>attributes:</strong> {<span class=\\\"lx-attr-key\\\">emotional_state</span>: <span class=\\\"lx-attr-value\\\">longing</span>}</div>\"}, {\"index\": 1, \"class\": \"emotion\", \"text\": \"gazed longingly\", \"color\": \"#C8E6C9\", \"startPos\": 12, \"endPos\": 27, \"beforeText\": \"Lady Juliet \", \"extractionText\": \"gazed longingly\", \"afterText\": \" at the stars, her heart aching for Romeo\", \"attributesHtml\": \"<div><strong>class:</strong> emotion</div><div><strong>attributes:</strong> {<span class=\\\"lx-attr-key\\\">feeling</span>: <span class=\\\"lx-attr-value\\\">intense desire</span>}</div>\"}, {\"index\": 2, \"class\": \"relationship\", \"text\": \"her heart aching for Romeo\", \"color\": \"#FEF0C3\", \"startPos\": 42, \"endPos\": 68, \"beforeText\": \"Lady Juliet gazed longingly at the stars, \", \"extractionText\": \"her heart aching for Romeo\", \"afterText\": \"\", \"attributesHtml\": \"<div><strong>class:</strong> relationship</div><div><strong>attributes:</strong> {<span class=\\\"lx-attr-key\\\">type</span>: <span class=\\\"lx-attr-value\\\">affectionate longing</span>}</div>\"}, {\"index\": 3, \"class\": \"character\", \"text\": \"Romeo\", \"color\": \"#D2E3FC\", \"startPos\": 63, \"endPos\": 68, \"beforeText\": \"Lady Juliet gazed longingly at the stars, her heart aching for \", \"extractionText\": \"Romeo\", \"afterText\": \"\", \"attributesHtml\": \"<div><strong>class:</strong> character</div><div><strong>attributes:</strong> {<span class=\\\"lx-attr-key\\\">emotional_state</span>: <span class=\\\"lx-attr-value\\\">desired</span>}</div>\"}];\n", |
225 | 227 | " let currentIndex = 0;\n",
|
226 | 228 | " let isPlaying = false;\n",
|
227 | 229 | " let animationInterval = null;\n",
|
|
0 commit comments