Nathan Butters commited on
Commit
7cbb17a
1 Parent(s): b0fc967
.ipynb_checkpoints/WNgen-checkpoint.py CHANGED
@@ -12,7 +12,7 @@ tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased-finetuned-sst
12
  model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")
13
  pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)
14
 
15
- #If an error is thrown that the corpus "omw-1.4" isn't discoverable you can use this code. (https://stackoverflow.com/questions/38916452/nltk-download-ssl-certificate-verify-failed)
16
  try:
17
  _create_unverified_https_context = ssl._create_unverified_context
18
  except AttributeError:
@@ -20,7 +20,7 @@ except AttributeError:
20
  else:
21
  ssl._create_default_https_context = _create_unverified_https_context
22
 
23
- nltk.download('omw-1.4')
24
 
25
  # A simple function to pull synonyms and antonyms using spacy's POS
26
  def syn_ant(word,POS=False,human=True):
 
12
  model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")
13
  pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)
14
 
15
+ '''#If an error is thrown that the corpus "omw-1.4" isn't discoverable you can use this code. (https://stackoverflow.com/questions/38916452/nltk-download-ssl-certificate-verify-failed)
16
  try:
17
  _create_unverified_https_context = ssl._create_unverified_context
18
  except AttributeError:
 
20
  else:
21
  ssl._create_default_https_context = _create_unverified_https_context
22
 
23
+ nltk.download('omw-1.4')'''
24
 
25
  # A simple function to pull synonyms and antonyms using spacy's POS
26
  def syn_ant(word,POS=False,human=True):
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -2,6 +2,7 @@
2
  import pandas as pd, spacy, nltk, numpy as np
3
  from spacy.matcher import Matcher
4
  nlp = spacy.load("en_core_web_lg")
 
5
 
6
  #Import the libraries to support the model and predictions.
7
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline
 
2
  import pandas as pd, spacy, nltk, numpy as np
3
  from spacy.matcher import Matcher
4
  nlp = spacy.load("en_core_web_lg")
5
+ nltk.download('omw-1.4')
6
 
7
  #Import the libraries to support the model and predictions.
8
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline
WNgen.py CHANGED
@@ -12,7 +12,7 @@ tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased-finetuned-sst
12
  model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")
13
  pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)
14
 
15
- #If an error is thrown that the corpus "omw-1.4" isn't discoverable you can use this code. (https://stackoverflow.com/questions/38916452/nltk-download-ssl-certificate-verify-failed)
16
  try:
17
  _create_unverified_https_context = ssl._create_unverified_context
18
  except AttributeError:
@@ -20,7 +20,7 @@ except AttributeError:
20
  else:
21
  ssl._create_default_https_context = _create_unverified_https_context
22
 
23
- nltk.download('omw-1.4')
24
 
25
  # A simple function to pull synonyms and antonyms using spacy's POS
26
  def syn_ant(word,POS=False,human=True):
 
12
  model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")
13
  pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)
14
 
15
+ '''#If an error is thrown that the corpus "omw-1.4" isn't discoverable you can use this code. (https://stackoverflow.com/questions/38916452/nltk-download-ssl-certificate-verify-failed)
16
  try:
17
  _create_unverified_https_context = ssl._create_unverified_context
18
  except AttributeError:
 
20
  else:
21
  ssl._create_default_https_context = _create_unverified_https_context
22
 
23
+ nltk.download('omw-1.4')'''
24
 
25
  # A simple function to pull synonyms and antonyms using spacy's POS
26
  def syn_ant(word,POS=False,human=True):
app.py CHANGED
@@ -2,6 +2,7 @@
2
  import pandas as pd, spacy, nltk, numpy as np
3
  from spacy.matcher import Matcher
4
  nlp = spacy.load("en_core_web_lg")
 
5
 
6
  #Import the libraries to support the model and predictions.
7
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline
 
2
  import pandas as pd, spacy, nltk, numpy as np
3
  from spacy.matcher import Matcher
4
  nlp = spacy.load("en_core_web_lg")
5
+ nltk.download('omw-1.4')
6
 
7
  #Import the libraries to support the model and predictions.
8
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline