Dusan Svilarkovic commited on
Commit
a10a948
β€’
1 Parent(s): 6b337ea
Files changed (48) hide show
  1. app.py +4 -10
  2. {naacl-2021-fudge-controlled-generation β†’ fudge}/LICENSE +0 -0
  3. {naacl-2021-fudge-controlled-generation β†’ fudge}/README.md +0 -0
  4. {naacl-2021-fudge-controlled-generation β†’ fudge}/clickbait_classifier.py +0 -0
  5. {naacl-2021-fudge-controlled-generation β†’ fudge}/constants.py +0 -0
  6. {naacl-2021-fudge-controlled-generation β†’ fudge}/data.py +0 -0
  7. {naacl-2021-fudge-controlled-generation β†’ fudge}/eval_formality_metrics.py +0 -0
  8. {naacl-2021-fudge-controlled-generation β†’ fudge}/eval_poetry_metrics.py +0 -0
  9. {naacl-2021-fudge-controlled-generation β†’ fudge}/eval_topic_metrics.py +0 -0
  10. {naacl-2021-fudge-controlled-generation β†’ fudge}/evaluate_clickbait.py +0 -0
  11. {naacl-2021-fudge-controlled-generation β†’ fudge}/evaluate_formality.py +0 -0
  12. {naacl-2021-fudge-controlled-generation β†’ fudge}/evaluate_poetry.py +0 -0
  13. {naacl-2021-fudge-controlled-generation β†’ fudge}/evaluate_topic.py +0 -0
  14. {naacl-2021-fudge-controlled-generation β†’ fudge}/formality_data/README.md +0 -0
  15. {naacl-2021-fudge-controlled-generation β†’ fudge}/formality_data/fisher_test_oracle.es +0 -0
  16. {naacl-2021-fudge-controlled-generation β†’ fudge}/formality_data/test.noid.cleaned_0 +0 -0
  17. {naacl-2021-fudge-controlled-generation β†’ fudge}/formality_data/test.noid.cleaned_1 +0 -0
  18. {naacl-2021-fudge-controlled-generation β†’ fudge}/main.py +0 -0
  19. {naacl-2021-fudge-controlled-generation β†’ fudge}/model.py +0 -0
  20. {naacl-2021-fudge-controlled-generation β†’ fudge}/poetry_data/README.md +0 -0
  21. {naacl-2021-fudge-controlled-generation β†’ fudge}/poetry_data/couplet_ends.txt +0 -0
  22. {naacl-2021-fudge-controlled-generation β†’ fudge}/poetry_data/couplet_prefixes.txt +0 -0
  23. {naacl-2021-fudge-controlled-generation β†’ fudge}/poetry_util.py +0 -0
  24. {naacl-2021-fudge-controlled-generation β†’ fudge}/predict_clickbait.py +0 -0
  25. {naacl-2021-fudge-controlled-generation β†’ fudge}/predict_formality.py +0 -0
  26. {naacl-2021-fudge-controlled-generation β†’ fudge}/predict_poetry.py +0 -0
  27. {naacl-2021-fudge-controlled-generation β†’ fudge}/predict_topic.py +0 -0
  28. {naacl-2021-fudge-controlled-generation β†’ fudge}/requirements.txt +4 -1
  29. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/README.md +0 -0
  30. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/computers.txt +0 -0
  31. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/legal.txt +0 -0
  32. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/military.txt +0 -0
  33. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/politics.txt +0 -0
  34. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/religion.txt +0 -0
  35. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/science.txt +0 -0
  36. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/space.txt +0 -0
  37. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/topic_prefixes.txt +0 -0
  38. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/val_wordlists/fantasy.txt +0 -0
  39. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/computers.txt +0 -0
  40. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/legal.txt +0 -0
  41. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/military.txt +0 -0
  42. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/politics.txt +0 -0
  43. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/religion.txt +0 -0
  44. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/science.txt +0 -0
  45. {naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/space.txt +0 -0
  46. {naacl-2021-fudge-controlled-generation β†’ fudge}/transcript.txt +0 -0
  47. {naacl-2021-fudge-controlled-generation β†’ fudge}/util.py +0 -0
  48. requirements.txt +10 -0
app.py CHANGED
@@ -3,7 +3,7 @@ import os
3
  os.chdir('naacl-2021-fudge-controlled-generation/')
4
 
5
  import gradio as gr
6
- from predict_clickbait import generate_clickbait
7
  from datasets import load_dataset,DatasetDict,Dataset
8
  # from datasets import
9
  from transformers import AutoTokenizer,AutoModelForSeq2SeqLM
@@ -13,13 +13,8 @@ import pandas as pd
13
  from sklearn.utils.class_weight import compute_class_weight
14
  import torch
15
  import pandas as pd
16
- from model import Model
17
- import imp
18
  import os
19
- import random
20
- import time
21
- import pickle
22
- import math
23
  from argparse import ArgumentParser
24
  from collections import namedtuple
25
  import mock
@@ -29,9 +24,8 @@ import numpy as np
29
  import torch.nn as nn
30
  import torch.nn.functional as F
31
  from data import Dataset
32
- from util import save_checkpoint, ProgressMeter, AverageMeter, num_params
33
- from constants import *
34
- from predict_clickbait import generate_clickbait, tokenizer, classifier_tokenizer
35
 
36
 
37
  # imp.reload(model)
 
3
  os.chdir('naacl-2021-fudge-controlled-generation/')
4
 
5
  import gradio as gr
6
+ from fudge.predict_clickbait import generate_clickbait, tokenizer, classifier_tokenizer
7
  from datasets import load_dataset,DatasetDict,Dataset
8
  # from datasets import
9
  from transformers import AutoTokenizer,AutoModelForSeq2SeqLM
 
13
  from sklearn.utils.class_weight import compute_class_weight
14
  import torch
15
  import pandas as pd
16
+ from fudge.model import Model
 
17
  import os
 
 
 
 
18
  from argparse import ArgumentParser
19
  from collections import namedtuple
20
  import mock
 
24
  import torch.nn as nn
25
  import torch.nn.functional as F
26
  from data import Dataset
27
+ from fudge.util import save_checkpoint, ProgressMeter, AverageMeter, num_params
28
+ from fudge.constants import *
 
29
 
30
 
31
  # imp.reload(model)
{naacl-2021-fudge-controlled-generation β†’ fudge}/LICENSE RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/README.md RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/clickbait_classifier.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/constants.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/data.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/eval_formality_metrics.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/eval_poetry_metrics.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/eval_topic_metrics.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/evaluate_clickbait.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/evaluate_formality.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/evaluate_poetry.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/evaluate_topic.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/formality_data/README.md RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/formality_data/fisher_test_oracle.es RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/formality_data/test.noid.cleaned_0 RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/formality_data/test.noid.cleaned_1 RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/main.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/model.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/poetry_data/README.md RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/poetry_data/couplet_ends.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/poetry_data/couplet_prefixes.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/poetry_util.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/predict_clickbait.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/predict_formality.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/predict_poetry.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/predict_topic.py RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/requirements.txt RENAMED
@@ -2,6 +2,9 @@ Phyme==0.0.9
2
  pronouncing==0.2.0
3
  pytorch-lightning==1.0.6
4
  torch==1.7.0
5
- tqdm==4.49.0
6
  sacrebleu==1.4.14
7
  sacremoses==0.0.43
 
 
 
 
2
  pronouncing==0.2.0
3
  pytorch-lightning==1.0.6
4
  torch==1.7.0
5
+ tqdm==4.62.1
6
  sacrebleu==1.4.14
7
  sacremoses==0.0.43
8
+ mock==4.0.3
9
+ torchtext==0.8.1 --no-deps
10
+ torchvision==0.8.2 --no-deps
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/README.md RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/computers.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/legal.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/military.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/politics.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/religion.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/science.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/test_wordlists/space.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/topic_prefixes.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/val_wordlists/fantasy.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/computers.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/legal.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/military.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/politics.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/religion.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/science.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/topic_data/wordlists/space.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/transcript.txt RENAMED
File without changes
{naacl-2021-fudge-controlled-generation β†’ fudge}/util.py RENAMED
File without changes
requirements.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ Phyme==0.0.9
2
+ pronouncing==0.2.0
3
+ pytorch-lightning==1.0.6
4
+ torch==1.7.0
5
+ tqdm==4.62.1
6
+ sacrebleu==1.4.14
7
+ sacremoses==0.0.43
8
+ mock==4.0.3
9
+ torchtext==0.8.1 --no-deps
10
+ torchvision==0.8.2 --no-deps