some work
Browse files- .gitattributes +1 -1
- CodeBLEU/__init__.py +0 -1
- README.md +1 -1
- app.py +1 -1
- CodeBLEU/bleu.py β bleu.py +1 -1
- codebleu.py +1 -1
- CodeBLEU/dataflow_match.py β dataflow_match.py +2 -2
- {CodeBLEU/keywords β keywords}/c_sharp.txt +0 -0
- {CodeBLEU/keywords β keywords}/java.txt +0 -0
- {CodeBLEU/keywords β keywords}/python.txt +0 -0
- CodeBLEU/my_codebleu.py β my_codebleu.py +4 -4
- {CodeBLEU/parser β parser}/DFG.py +0 -0
- {CodeBLEU/parser β parser}/__init__.py +0 -0
- {CodeBLEU/parser β parser}/build.py +0 -0
- {CodeBLEU/parser β parser}/build.sh +0 -0
- {CodeBLEU/parser β parser}/my-languages.so +0 -0
- {CodeBLEU/parser β parser}/utils.py +0 -0
- CodeBLEU/predictions.txt β predictions.txt +0 -0
- CodeBLEU/readme.txt β readme.txt +0 -0
- CodeBLEU/references.txt β references.txt +0 -0
- CodeBLEU/syntax_match.py β syntax_match.py +2 -2
- CodeBLEU/utils.py β utils.py +0 -0
- CodeBLEU/weighted_ngram_match.py β weighted_ngram_match.py +1 -1
.gitattributes
CHANGED
@@ -29,4 +29,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
29 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
30 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
32 |
-
|
|
|
29 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
30 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
32 |
+
parser/my-languages.so filter=lfs diff=lfs merge=lfs -text
|
CodeBLEU/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
from .my_codebleu import calc_codebleu
|
|
|
|
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
datasets:
|
4 |
-
|
5 |
tags:
|
|
|
1 |
---
|
2 |
+
title: codebleu
|
3 |
datasets:
|
4 |
-
|
5 |
tags:
|
app.py
CHANGED
@@ -2,5 +2,5 @@ import evaluate
|
|
2 |
from evaluate.utils import launch_gradio_widget
|
3 |
|
4 |
|
5 |
-
module = evaluate.load("
|
6 |
launch_gradio_widget(module)
|
|
|
2 |
from evaluate.utils import launch_gradio_widget
|
3 |
|
4 |
|
5 |
+
module = evaluate.load("codebleu")
|
6 |
launch_gradio_widget(module)
|
CodeBLEU/bleu.py β bleu.py
RENAMED
@@ -15,7 +15,7 @@ from fractions import Fraction
|
|
15 |
import warnings
|
16 |
from collections import Counter
|
17 |
|
18 |
-
from
|
19 |
import pdb
|
20 |
|
21 |
|
|
|
15 |
import warnings
|
16 |
from collections import Counter
|
17 |
|
18 |
+
from utils import ngrams
|
19 |
import pdb
|
20 |
|
21 |
|
codebleu.py
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
import evaluate
|
17 |
import datasets
|
18 |
|
19 |
-
from .
|
20 |
|
21 |
|
22 |
# TODO: Add BibTeX citation
|
|
|
16 |
import evaluate
|
17 |
import datasets
|
18 |
|
19 |
+
from .my_codebleu import calc_codebleu
|
20 |
|
21 |
|
22 |
# TODO: Add BibTeX citation
|
CodeBLEU/dataflow_match.py β dataflow_match.py
RENAMED
@@ -2,8 +2,8 @@
|
|
2 |
# Licensed under the MIT license.
|
3 |
|
4 |
import os
|
5 |
-
from
|
6 |
-
from
|
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)
|
{CodeBLEU/keywords β keywords}/c_sharp.txt
RENAMED
File without changes
|
{CodeBLEU/keywords β keywords}/java.txt
RENAMED
File without changes
|
{CodeBLEU/keywords β keywords}/python.txt
RENAMED
File without changes
|
CodeBLEU/my_codebleu.py β my_codebleu.py
RENAMED
@@ -4,10 +4,10 @@
|
|
4 |
# -*- coding:utf-8 -*-
|
5 |
import os
|
6 |
import logging
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
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 |
+
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'):
|
{CodeBLEU/parser β parser}/DFG.py
RENAMED
File without changes
|
{CodeBLEU/parser β parser}/__init__.py
RENAMED
File without changes
|
{CodeBLEU/parser β parser}/build.py
RENAMED
File without changes
|
{CodeBLEU/parser β parser}/build.sh
RENAMED
File without changes
|
{CodeBLEU/parser β parser}/my-languages.so
RENAMED
File without changes
|
{CodeBLEU/parser β parser}/utils.py
RENAMED
File without changes
|
CodeBLEU/predictions.txt β predictions.txt
RENAMED
File without changes
|
CodeBLEU/readme.txt β readme.txt
RENAMED
File without changes
|
CodeBLEU/references.txt β references.txt
RENAMED
File without changes
|
CodeBLEU/syntax_match.py β syntax_match.py
RENAMED
@@ -2,8 +2,8 @@
|
|
2 |
# Licensed under the MIT license.
|
3 |
|
4 |
import os
|
5 |
-
from
|
6 |
-
from
|
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)
|
CodeBLEU/utils.py β utils.py
RENAMED
File without changes
|
CodeBLEU/weighted_ngram_match.py β weighted_ngram_match.py
RENAMED
@@ -18,7 +18,7 @@ from fractions import Fraction
|
|
18 |
import warnings
|
19 |
from collections import Counter
|
20 |
|
21 |
-
from
|
22 |
import pdb
|
23 |
|
24 |
|
|
|
18 |
import warnings
|
19 |
from collections import Counter
|
20 |
|
21 |
+
from utils import ngrams
|
22 |
import pdb
|
23 |
|
24 |
|