添加文本信息抽取接口
This commit is contained in:
@@ -22,6 +22,13 @@ def main():
|
||||
return COST({'doc': img_path, 'layout': json.loads(layout)})
|
||||
|
||||
|
||||
@app.route('/text', methods=['POST'])
|
||||
@process_request
|
||||
def text():
|
||||
t = request.form.get('text')
|
||||
return COST(t)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
logging.config.dictConfig(LOGGING_CONFIG)
|
||||
app.run('0.0.0.0', 5004)
|
||||
|
||||
@@ -24,6 +24,13 @@ def main():
|
||||
return DISCHARGE({'doc': img_path, 'layout': json.loads(layout)})
|
||||
|
||||
|
||||
@app.route('/text', methods=['POST'])
|
||||
@process_request
|
||||
def text():
|
||||
t = request.form.get('text')
|
||||
return DISCHARGE(t)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
logging.config.dictConfig(LOGGING_CONFIG)
|
||||
app.run('0.0.0.0', 5003)
|
||||
|
||||
@@ -28,6 +28,13 @@ def main():
|
||||
return SETTLEMENT_IE({'doc': img_path, 'layout': json.loads(layout)})
|
||||
|
||||
|
||||
@app.route('/text', methods=['POST'])
|
||||
@process_request
|
||||
def text():
|
||||
t = request.form.get('text')
|
||||
return SETTLEMENT_IE(t)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
logging.config.dictConfig(LOGGING_CONFIG)
|
||||
app.run('0.0.0.0', 5002)
|
||||
|
||||
Reference in New Issue
Block a user