Sheet2metadata
Sheet2Metadata
Source code in Docs2KG/modules/llm/sheet2metadata.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
__init__(markdown_file, llm_model_name='gpt-3.5-turbo-0125')
- Extract the descriptive part of the markdown
- Summary the markdown
Parameters:
Name | Type | Description | Default |
---|---|---|---|
markdown_file |
Path
|
The path to the markdown file |
required |
llm_model_name |
str
|
The OpenAI LLM model name |
'gpt-3.5-turbo-0125'
|
Source code in Docs2KG/modules/llm/sheet2metadata.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
llm_openai_call(messages)
Call the OpenAI API to get the response Args: messages (List[dict]): The messages to send to the OpenAI API
Returns:
Name | Type | Description |
---|---|---|
response_json_str |
str
|
The response from the OpenAI API |
Source code in Docs2KG/modules/llm/sheet2metadata.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
openai_sheet_handler(markdown)
- Use OpenAI to exclude the numerical part of the markdown, only keep the descriptive part
- Summarize the markdown
Parameters:
Name | Type | Description | Default |
---|---|---|---|
markdown |
str
|
|
required |
Returns:
Source code in Docs2KG/modules/llm/sheet2metadata.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|