蒸发
基础蒸发程序 #
Bases: BasePydanticProgram, Generic[Model]
基础蒸发程序。
您应当提供想要提取的字段。 然后在调用程序时,应当传入一个训练数据节点列表 和一个推理数据节点列表。程序将调用 EvaporateExtractor 从训练数据中合成一个 Python 函数,然后将该函数 应用于推理数据。
workflows/handler.py 中的源代码llama_index/program/evaporate/base.py
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 | |
from_defaults
classmethod
#
from_defaults(fields_to_extract: Optional[List[str]] = None, fields_context: Optional[Dict[str, Any]] = None, llm: Optional[大语言模型] = None, schema_id_prompt: Optional[SchemaIDPrompt] = None, fn_generate_prompt: Optional[FnGeneratePrompt] = None, field_extract_query_tmpl: str = DEFAULT_FIELD_EXTRACT_QUERY_TMPL, nodes_to_fit: Optional[List[BaseNode]] = None, verbose: bool = False) -> BaseEvaporateProgram
蒸发程序。
workflows/handler.py 中的源代码llama_index/program/evaporate/base.py
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 | |
get_function_str #
get_function_str(field: str) -> str
获取函数字符串。
workflows/handler.py 中的源代码llama_index/program/evaporate/base.py
89 90 91 | |
set_fields_to_extract #
set_fields_to_extract(fields: List[str]) -> None
设置要提取的字段。
workflows/handler.py 中的源代码llama_index/program/evaporate/base.py
93 94 95 | |
fit_fields #
fit_fields(nodes: List[BaseNode], inplace: bool = True) -> Dict[str, str]
在所有字段上进行拟合。
workflows/handler.py 中的源代码llama_index/program/evaporate/base.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
拟合
abstractmethod
#
fit(nodes: List[BaseNode], field: str, field_context: Optional[Any] = None, expected_output: Optional[Any] = None, inplace: bool = True) -> str
根据输入的节点和字段,合成相应的Python代码。
workflows/handler.py 中的源代码llama_index/program/evaporate/base.py
114 115 116 117 118 119 120 121 122 123 | |
DFEvaporate程序 #
基类:EventBaseEvaporateProgram[DataFrameRowsOnly]
蒸发数据框程序。
给定一组字段,从一组节点中提取数据框。 每个节点对应数据框中的一行 - 行中的每个值 对应一个字段值。
workflows/handler.py 中的源代码llama_index/program/evaporate/base.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
拟合 #
fit(nodes: List[BaseNode], field: str, field_context: Optional[Any] = None, expected_output: Optional[Any] = None, inplace: bool = True) -> str
根据输入的节点和字段,合成相应的Python代码。
workflows/handler.py 中的源代码llama_index/program/evaporate/base.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
选项: 成员:- DFEvaporateProgram