添加文本信息抽取接口

This commit is contained in:
2024-09-27 15:31:11 +08:00
parent 46be9a26be
commit 7a4cb5263a
4 changed files with 69 additions and 0 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)