some work
Browse files- app.py +1 -1
- bleu.py +1 -1
- dataflow_match.py +2 -2
- my_codebleu.py +4 -4
- syntax_match.py +2 -2
- weighted_ngram_match.py +1 -1
app.py
CHANGED
@@ -2,5 +2,5 @@ import evaluate
|
|
2 |
from evaluate.utils import launch_gradio_widget
|
3 |
|
4 |
|
5 |
-
module = evaluate.load("codebleu")
|
6 |
launch_gradio_widget(module)
|
|
|
2 |
from evaluate.utils import launch_gradio_widget
|
3 |
|
4 |
|
5 |
+
module = evaluate.load("idsedykh/codebleu")
|
6 |
launch_gradio_widget(module)
|
bleu.py
CHANGED
@@ -15,7 +15,7 @@ from fractions import Fraction
|
|
15 |
import warnings
|
16 |
from collections import Counter
|
17 |
|
18 |
-
from utils import ngrams
|
19 |
import pdb
|
20 |
|
21 |
|
|
|
15 |
import warnings
|
16 |
from collections import Counter
|
17 |
|
18 |
+
from .utils import ngrams
|
19 |
import pdb
|
20 |
|
21 |
|
dataflow_match.py
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
# Licensed under the MIT license.
|
3 |
|
4 |
import os
|
5 |
-
from parser import DFG_python,DFG_java,DFG_ruby,DFG_go,DFG_php,DFG_javascript,DFG_csharp
|
6 |
-
from parser import (remove_comments_and_docstrings,
|
7 |
tree_to_token_index,
|
8 |
index_to_code_token,
|
9 |
tree_to_variable_index)
|
|
|
2 |
# Licensed under the MIT license.
|
3 |
|
4 |
import os
|
5 |
+
from .parser import DFG_python,DFG_java,DFG_ruby,DFG_go,DFG_php,DFG_javascript,DFG_csharp
|
6 |
+
from .parser import (remove_comments_and_docstrings,
|
7 |
tree_to_token_index,
|
8 |
index_to_code_token,
|
9 |
tree_to_variable_index)
|
my_codebleu.py
CHANGED
@@ -4,10 +4,10 @@
|
|
4 |
# -*- coding:utf-8 -*-
|
5 |
import os
|
6 |
import logging
|
7 |
-
import bleu
|
8 |
-
import weighted_ngram_match
|
9 |
-
import syntax_match
|
10 |
-
import dataflow_match
|
11 |
|
12 |
|
13 |
def calc_codebleu(predictions, references, lang, tokenizer=None, params='0.25,0.25,0.25,0.25'):
|
|
|
4 |
# -*- coding:utf-8 -*-
|
5 |
import os
|
6 |
import logging
|
7 |
+
from . import bleu
|
8 |
+
from . import weighted_ngram_match
|
9 |
+
from . import syntax_match
|
10 |
+
from . import dataflow_match
|
11 |
|
12 |
|
13 |
def calc_codebleu(predictions, references, lang, tokenizer=None, params='0.25,0.25,0.25,0.25'):
|
syntax_match.py
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
# Licensed under the MIT license.
|
3 |
|
4 |
import os
|
5 |
-
from parser import DFG_python,DFG_java,DFG_ruby,DFG_go,DFG_php,DFG_javascript,DFG_csharp
|
6 |
-
from parser import (remove_comments_and_docstrings,
|
7 |
tree_to_token_index,
|
8 |
index_to_code_token,
|
9 |
tree_to_variable_index)
|
|
|
2 |
# Licensed under the MIT license.
|
3 |
|
4 |
import os
|
5 |
+
from .parser import DFG_python,DFG_java,DFG_ruby,DFG_go,DFG_php,DFG_javascript,DFG_csharp
|
6 |
+
from .parser import (remove_comments_and_docstrings,
|
7 |
tree_to_token_index,
|
8 |
index_to_code_token,
|
9 |
tree_to_variable_index)
|
weighted_ngram_match.py
CHANGED
@@ -18,7 +18,7 @@ from fractions import Fraction
|
|
18 |
import warnings
|
19 |
from collections import Counter
|
20 |
|
21 |
-
from utils import ngrams
|
22 |
import pdb
|
23 |
|
24 |
|
|
|
18 |
import warnings
|
19 |
from collections import Counter
|
20 |
|
21 |
+
from .utils import ngrams
|
22 |
import pdb
|
23 |
|
24 |
|