Skip to content

Commit f59f589

Browse files
Merge pull request #141 from SuffolkLITLab/patch-for-breaking-change
quick and dirty patch
2 parents 81356ca + 897e0cc commit f59f589

File tree

4 files changed

+354
-287
lines changed

4 files changed

+354
-287
lines changed

dev-testing/functions.ipynb

Lines changed: 23 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,19 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 11,
5+
"execution_count": 1,
66
"id": "cc93a668",
77
"metadata": {},
88
"outputs": [
9-
{
10-
"name": "stderr",
11-
"output_type": "stream",
12-
"text": [
13-
"None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.\n"
14-
]
15-
},
169
{
1710
"data": {
1811
"application/vnd.jupyter.widget-view+json": {
19-
"model_id": "daa35a202b9944a981d2163df1c63c60",
12+
"model_id": "5bd625018f6247fab661ce6d838cb40c",
2013
"version_major": 2,
2114
"version_minor": 0
2215
},
2316
"text/plain": [
24-
"Downloading: 0%| | 0.00/1.04M [00:00<?, ?B/s]"
25-
]
26-
},
27-
"metadata": {},
28-
"output_type": "display_data"
29-
},
30-
{
31-
"data": {
32-
"application/vnd.jupyter.widget-view+json": {
33-
"model_id": "bebdf1cab3a0459d8287208bd0923907",
34-
"version_major": 2,
35-
"version_minor": 0
36-
},
37-
"text/plain": [
38-
"Downloading: 0%| | 0.00/456k [00:00<?, ?B/s]"
39-
]
40-
},
41-
"metadata": {},
42-
"output_type": "display_data"
43-
},
44-
{
45-
"data": {
46-
"application/vnd.jupyter.widget-view+json": {
47-
"model_id": "292dc7fa30e14ed29d3fd1c547a1c121",
48-
"version_major": 2,
49-
"version_minor": 0
50-
},
51-
"text/plain": [
52-
"Downloading: 0%| | 0.00/1.36M [00:00<?, ?B/s]"
53-
]
54-
},
55-
"metadata": {},
56-
"output_type": "display_data"
57-
},
58-
{
59-
"data": {
60-
"application/vnd.jupyter.widget-view+json": {
61-
"model_id": "c8b65b559f5e42dc9c3015181358047b",
62-
"version_major": 2,
63-
"version_minor": 0
64-
},
65-
"text/plain": [
66-
"Downloading: 0%| | 0.00/665 [00:00<?, ?B/s]"
17+
"Downloading: 0%| | 0.00/26.0 [00:00<?, ?B/s]"
6718
]
6819
},
6920
"metadata": {},
@@ -139,31 +90,32 @@
13990
},
14091
{
14192
"cell_type": "code",
142-
"execution_count": 12,
93+
"execution_count": 2,
14394
"id": "e158174f",
14495
"metadata": {},
14596
"outputs": [],
14697
"source": [
14798
"stop_words = set(stopwords.words(\"english\"))\n",
14899
"\n",
149-
"try:\n",
150-
" # this takes a while to load\n",
151-
" import en_core_web_lg\n",
100+
"if 1==2:\n",
101+
" try:\n",
102+
" # this takes a while to load\n",
103+
" import en_core_web_lg\n",
152104
"\n",
153-
" nlp = en_core_web_lg.load()\n",
154-
"except:\n",
155-
" print(\"Downloading word2vec model en_core_web_lg\")\n",
156-
" import subprocess\n",
105+
" nlp = en_core_web_lg.load()\n",
106+
" except:\n",
107+
" print(\"Downloading word2vec model en_core_web_lg\")\n",
108+
" import subprocess\n",
157109
"\n",
158-
" bashCommand = \"python -m spacy download en_core_web_lg\"\n",
159-
" process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)\n",
160-
" output, error = process.communicate()\n",
161-
" print(f\"output of word2vec model download: {str(output)}\")\n",
162-
" import en_core_web_lg\n",
110+
" bashCommand = \"python -m spacy download en_core_web_lg\"\n",
111+
" process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)\n",
112+
" output, error = process.communicate()\n",
113+
" print(f\"output of word2vec model download: {str(output)}\")\n",
114+
" import en_core_web_lg\n",
163115
"\n",
164-
" nlp = en_core_web_lg.load()\n",
116+
" nlp = en_core_web_lg.load()\n",
165117
"\n",
166-
"passivepy = PassivePy.PassivePyAnalyzer(nlp=nlp)"
118+
" passivepy = PassivePy.PassivePyAnalyzer(nlp=nlp)"
167119
]
168120
},
169121
{
@@ -198,6 +150,8 @@
198150
"jurisdictions = load(\"../formfyxer/data/jurisdictions.joblib\")\n",
199151
"groups = load(\"../formfyxer/data/groups.joblib\")\n",
200152
"clf_field_names = load(\"../formfyxer/data/clf_field_names.joblib\")\n",
153+
"with open(\"../../keys/tools_token.txt\", \"r\") as file:\n",
154+
" tools_token = file.read().rstrip()\n",
201155
"with open(\"../../keys/spot_token.txt\", \"r\") as file:\n",
202156
" spot_token = file.read().rstrip()\n",
203157
"with open(\"../../keys/openai_org.txt\", \"r\") as file:\n",
@@ -3045,7 +2999,7 @@
30452999
],
30463000
"metadata": {
30473001
"kernelspec": {
3048-
"display_name": "Python 3.8.10 64-bit",
3002+
"display_name": "Python 3 (ipykernel)",
30493003
"language": "python",
30503004
"name": "python3"
30513005
},
@@ -3059,7 +3013,7 @@
30593013
"name": "python",
30603014
"nbconvert_exporter": "python",
30613015
"pygments_lexer": "ipython3",
3062-
"version": "3.8.10"
3016+
"version": "3.8.12"
30633017
},
30643018
"vscode": {
30653019
"interpreter": {

0 commit comments

Comments
 (0)