How to get the data conversion results of the predicted code from Amazon remote server, the LAN can't access the Amazon server by request.post() to get response.text
iamchenxin-coder opened this issue · 2 comments
Hello, urialon,Could you tell me what is in https://po3g2dx2qa.execute-api.us-east-1.amazonaws.com/production/extractmethods process that it can convert the source code(in Input.java) to json format output? And what should I do the same processing in offline? plz tell me how to do it, Can you send me a copy of the server's processing code? I would really appreciate your help.
Request the website to do the following processing to convert the input code into JSON format data composed of target, paths and AST
Input.java :
public String getName() {
return name;
}
Data format converted by server:
{
'target': 'get|name',
'paths': [{
'name1': 'string',
'name2': 'METHOD_NAME',
'shortPath': 'Cls0|Mth|Nm1',
'path': '(ClassOrInterfaceType0)^(MethodDeclaration)(NameExpr1)',
'name1NodeId': 2,
'name2NodeId': 3,
'name1TokenNum': 0,
'name2TokenNum': 0
}, {
'name1': 'string',
'name2': 'name',
'shortPath': 'Cls0|Mth|Bk|Ret|Nm0',
'path': '(ClassOrInterfaceType0)^(MethodDeclaration)(BlockStmt)(ReturnStmt)(NameExpr0)',
'name1NodeId': 2,
'name2NodeId': 6,
'name1TokenNum': 0,
'name2TokenNum': 0
}, {
'name1': 'METHOD_NAME',
'name2': 'name',
'shortPath': 'Nm1|Mth|Bk|Ret|Nm0',
'path': '(NameExpr1)^(MethodDeclaration)(BlockStmt)(ReturnStmt)_(NameExpr0)',
'name1NodeId': 3,
'name2NodeId': 6,
'name1TokenNum': 0,
'name2TokenNum': 0
}],
'ast': {
'id': 0,
'children': [{
'id': 1,
'type': 'MethodDeclaration',
'children': [{
'id': 2,
'name': 'String',
'type': 'ClassOrInterfaceType'
}, {
'id': 3,
'name': 'getName',
'type': 'NameExpr'
}, {
'id': 4,
'type': 'BlockStmt',
'children': [{
'id': 5,
'type': 'ReturnStmt',
'children': [{
'id': 6,
'name': 'name',
'type': 'NameExpr'
}]
}]
}]
}]
}
}
Hi @iamchenxin-coder ,
Thank you for your interest in code2seq!
This API runs the same code that the JavaExtractor
runs offline, but for a single example at a time.
For preprocessing of datasets, please use the preprocess.sh
script that uses JavaExtractor
.
Best,
Uri
Closing due to inactivity, feel free to re-open if there are any more questions.