maximuspowers commited on
Commit
5dad7c8
·
verified ·
1 Parent(s): 9232f42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -1,6 +1,14 @@
1
  import gradio as gr
2
  import nlpaug.augmenter.word as naw
3
 
 
 
 
 
 
 
 
 
4
  # augmentations
5
  def augment_text(text, aug_type, model_type=None, model_path=None, aug_p=0.25, aug_max=3):
6
  if aug_type == 'Word Embedding Substitution':
 
1
  import gradio as gr
2
  import nlpaug.augmenter.word as naw
3
 
4
+ DownloadUtil.download_word2vec(dest_dir = '.')
5
+ # Possible values are ‘wiki-news-300d-1M’, ‘wiki-news-300d-1M-subword’, ‘crawl-300d-2M’ and ‘crawl-300d-2M-subword’
6
+
7
+ DownloadUtil.download_fasttext(dest_dir = '.', model_name = 'crawl-300d-2M')
8
+
9
+ # for synonym replacement
10
+ DownloadUtil.download_glove(dest_dir = '.', model_name = 'glove.6B')
11
+
12
  # augmentations
13
  def augment_text(text, aug_type, model_type=None, model_path=None, aug_p=0.25, aug_max=3):
14
  if aug_type == 'Word Embedding Substitution':