We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
解析好后不管是复制md还是json都直接卡死,没找到直接保存的选项
The text was updated successfully, but these errors were encountered:
可以自己调接口,读返回的json,解析text和images字段,分别保存。我用python的requests库实现了一下:
import requests #### api request #### url = 'http://localhost:8000/parse_document' file_path = 'test.pdf' with open(file_path, 'rb') as f: files = {'file': f} response = requests.post(url, files=files) result = response.json() #### save markdown #### text = result['text'] with open("./parse_results/test.md", "w") as f: f.write(text) #### save images #### import base64 from PIL import Image from io import BytesIO for raw in result['images']: raw_decode = base64.b64decode(raw['image']) image_name = raw['image_name'] Image.open(BytesIO(raw_decode)).save(f'./parse_results/{image_name}', 'PNG')
Sorry, something went wrong.
No branches or pull requests
解析好后不管是复制md还是json都直接卡死,没找到直接保存的选项
The text was updated successfully, but these errors were encountered: