Skip to content

Commit

Permalink
added tldr to sentence equality
Browse files Browse the repository at this point in the history
  • Loading branch information
“Dean committed Aug 12, 2024
1 parent 1e31790 commit 42a8b8b
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions nbs/tutorials/001_basic_tasks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,25 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": []
"source": [
"```python\n",
"%%spannerlog\n",
"\n",
"# split documents into sentences with the split ie function\n",
"Sents(doc_id,sent)<-\n",
" Docs(doc_id,text),split(text)->(sent).\n",
"\n",
"# get all pairs of equal sentences using the eq_content_spans ie function\n",
"# make sure we only get unique pairs by using the span_lt ie function to avoid symmetry\n",
"EqualSentsUnique(doc_id1,sent1,doc_id2,sent2)<-\n",
" Sents(doc_id1,sent1),\n",
" Sents(doc_id2,sent2),\n",
" span_lt(sent1,sent2)->(True),\n",
" eq_content_spans(sent1,sent2)->(True).\n",
"```"
]
},
{
"cell_type": "markdown",
Expand Down

0 comments on commit 42a8b8b

Please sign in to comment.