Dependency tree for sentence structure and made notebook funcions importable wit new py file
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"import import_ipynb\n",
|
||||
"from notebooks.02_baseline_experiments.ipynb import *\n",
|
||||
"#from notebooks. import *\n",
|
||||
"\n",
|
||||
"import spacy\n",
|
||||
"nlp = spacy.load(\"en_core_web_md\")\n",
|
||||
@@ -77,7 +77,7 @@
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"def sentence_similarity_ang(sent1, sent2):\n",
|
||||
"def sentence_similarity_avg(sent1, sent2):\n",
|
||||
" doc1 = nlp(sent1)\n",
|
||||
" doc2 = nlp(sent2)\n",
|
||||
"\n",
|
||||
@@ -99,6 +99,24 @@
|
||||
"id": "68a6757447e4a1c7",
|
||||
"outputs": [],
|
||||
"execution_count": 3
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "markdown",
|
||||
"source": "SIF - Smooth Inverse Similarity",
|
||||
"id": "a9c3aa050f5bc0fe"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"def sentence_similarity_sif(sent1, sent2):\n",
|
||||
" doc1 = nlp(sent1)\n",
|
||||
" doc2 = nlp(sent2)"
|
||||
],
|
||||
"id": "c100956f89d9b581"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
Reference in New Issue
Block a user