prompt verbesserungen

This commit is contained in:
Ralph Soika 2024-09-07 11:06:02 +02:00
parent 7b52cba5cf
commit 1c310de954
7 changed files with 37 additions and 34 deletions

View file

@ -43,7 +43,7 @@ import jakarta.inject.Inject;
* <cdtr.name>...</cdtr.name> * <cdtr.name>...</cdtr.name>
* <invoice.number>...</invoice.number> * <invoice.number>...</invoice.number>
* <invoice.date>2024-12-31</invoice.date> * <invoice.date>2024-12-31</invoice.date>
* <payment.date>2024-12-31</payment.date> * <invoice.duedate>2024-12-31</invoice.duedate>
* <invoice.total type="double">1234.00</invoice.total> * <invoice.total type="double">1234.00</invoice.total>
* <cdtr.iban>...</cdtr.iban> * <cdtr.iban>...</cdtr.iban>
* <cdtr.bic>...</cdtr.bic> * <cdtr.bic>...</cdtr.bic>
@ -99,7 +99,7 @@ public class PromptExampleAdapterXML {
* <cdtr.name>...</cdtr.name> * <cdtr.name>...</cdtr.name>
* <invoice.number>...</invoice.number> * <invoice.number>...</invoice.number>
* <invoice.date>2024-12-31</invoice.date> * <invoice.date>2024-12-31</invoice.date>
* <payment.date>2024-12-31</payment.date> * <invoice.duedate>2024-12-31</invoice.duedate>
* <invoice.total type="double">1234.00</invoice.total> * <invoice.total type="double">1234.00</invoice.total>
* <cdtr.iban>...</cdtr.iban> * <cdtr.iban>...</cdtr.iban>
* <cdtr.bic>...</cdtr.bic> * <cdtr.bic>...</cdtr.bic>
@ -130,10 +130,10 @@ public class PromptExampleAdapterXML {
" <invoice.date>" + dateFormat.format(invoice.getItemValueDate("invoice.date")) " <invoice.date>" + dateFormat.format(invoice.getItemValueDate("invoice.date"))
+ "</invoice.date>\n"); + "</invoice.date>\n");
} }
if (invoice.getItemValueDate("payment.date") != null) { if (invoice.getItemValueDate("invoice.duedate") != null) {
example.append( example.append(
" <payment.date>" + dateFormat.format(invoice.getItemValueDate("payment.date")) " <invoice.duedate>" + dateFormat.format(invoice.getItemValueDate("invoice.duedate"))
+ "</payment.date>\n"); + "</invoice.duedate>\n");
} }
example.append(" <invoice.total type=\"double\">" + invoice.getItemValueDouble("invoice.total") example.append(" <invoice.total type=\"double\">" + invoice.getItemValueDouble("invoice.total")
+ "</invoice.total>\n"); + "</invoice.total>\n");

View file

@ -689,7 +689,7 @@ Betrag: <itemvalue>_amount</itemvalue> (Brutto € <itemvalue>_amount_brutto</it
<cdtr.name>...</cdtr.name> <cdtr.name>...</cdtr.name>
<invoice.number>...</invoice.number> <invoice.number>...</invoice.number>
<invoice.date>2024-12-31</invoice.date> <invoice.date>2024-12-31</invoice.date>
<payment.date>2024-12-31</payment.date> <invoice.duedate>2024-12-31</invoice.duedate>
<invoice.total type="double">1234.00</invoice.total> <invoice.total type="double">1234.00</invoice.total>
<cdtr.iban>...</cdtr.iban> <cdtr.iban>...</cdtr.iban>
<cdtr.bic>...</cdtr.bic> <cdtr.bic>...</cdtr.bic>
@ -703,9 +703,9 @@ Transfer the individual invoice data to the XML tags, taking into account the fo
- Total ==> "invoice.total" (in EUR or if not available in USD or PLN) - Total ==> "invoice.total" (in EUR or if not available in USD or PLN)
- IBAN ==> "cdtr.iban" - IBAN ==> "cdtr.iban"
- BIC or SWIFT ==> "cdtr.bic" - BIC or SWIFT ==> "cdtr.bic"
- Payment date / Due date ==> "payment.date" - Payment date / Due date ==> "invoice.duedate"
Note: Output only the XML object! Don't add explanations or comments. Use only the XML structure specified in this example and do not create any other XML tags. If you don't have data for some fields, leave the corresponding XML tags blank. Format date values (invoice.date, payment.date) into the ISO 8601 format (YYYY-MM-DD). Format numbers and amounts (type="double") according to ISO 4217. Note: Output only the XML object! Don't add explanations or comments. Use only the XML structure specified in this example and do not create any other XML tags. If you don't have data for some fields, leave the corresponding XML tags blank. Format date values (invoice.date, invoice.duedate) into the ISO 8601 format (YYYY-MM-DD). Format numbers and amounts (type="double") according to ISO 4217.
<<EXAMPLES_XML>> <<EXAMPLES_XML>>
@ -874,6 +874,7 @@ Note: Output only the XML object! Don't add explanations or comments. Use only t
<endpoint>https://llama.cpp.imixs.com/</endpoint> <endpoint>https://llama.cpp.imixs.com/</endpoint>
<result-event>XML</result-event> <result-event>XML</result-event>
</imixs-ai> </imixs-ai>
<item name="process">Empfang</item>
]]></imixs:value> ]]></imixs:value>
@ -908,7 +909,7 @@ Note: Output only the XML object! Don't add explanations or comments. Use only t
Extract also the company name and the language the invoice is written in. Extract also the company name and the language the invoice is written in.
Note: The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. Note: The company name is the name of the company that issued the invoice document and not the name of the recipient. As a rule, it is not Alexander Global Logistics either. The company name is often at the beginning or end of the invoice document.
Output the infromation as one XML object that has the following structure: Output the infromation as one XML object that has the following structure:
@ -1004,7 +1005,6 @@ Note: Do not generate any other information instead of the XML object. Do not ge
<debug>true</debug> <debug>true</debug>
</imixs-ai> </imixs-ai>
<validation name="required">false</validation> <validation name="required">false</validation>
]]></imixs:value> ]]></imixs:value>
</imixs:item> </imixs:item>
</bpmn2:extensionElements> </bpmn2:extensionElements>
@ -1031,7 +1031,7 @@ Note: Do not generate any other information instead of the XML object. Do not ge
<bpmn2:documentation id="documentation_8puQcA" open-bpmn:file-link="file://prompts/invoice-summarize-en.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <bpmn2:documentation id="documentation_8puQcA" open-bpmn:file-link="file://prompts/invoice-summarize-en.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<PromptDefinition> <PromptDefinition>
<prompt_options>{"n_predict": 4096, "temperature": 0}</prompt_options> <prompt_options>{"n_predict": 4096, "temperature": 0}</prompt_options>
<prompt><![CDATA[[INST]You are a clerk at the logistic company 'Alexander Global Logistics'. Your task is to check incoming invoices. [/INST] <prompt><![CDATA[[INST]You are an employee at the logistic company 'Alexander Global Logistics'. Your job is to check incoming invoice documents and forward them internally to employees. [/INST]
<FILECONTEXT>^.+\.([pP][dD][fF])$</FILECONTEXT> <FILECONTEXT>^.+\.([pP][dD][fF])$</FILECONTEXT>
@ -1039,17 +1039,18 @@ Note: Do not generate any other information instead of the XML object. Do not ge
Summarize the data from this invoice document: Summarize the data from this invoice document:
- Company information - Vendor information
- General Billing data - General Billing data
- Invoice total information - Invoice total information
- Payment summary - Payment summary (including bank data)
- Invoice items - Invoice items
The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. Note: The vendor information refers to the sender of the invoice. The company name is the name of the company that issued the invoice document and not the name of the recipient. As a rule, it is not Alexander Global Logistics either. The company name is often at the beginning or end of the invoice document.
Summarize the invoice lines in a table.
Use only the default values and do not perform any calculations, summing or changes to these values yourself. Format numbers and amounts according to ISO 4217. Use only the default values and do not perform any calculations, summing or changes to these values yourself. Format numbers and amounts according to ISO 4217.
If possible summarize the invoice lines in a table.
[/INST] [/INST]
]]]]><![CDATA[> ]]]]><![CDATA[>
</prompt> </prompt>

View file

@ -689,7 +689,7 @@ Betrag: <itemvalue>_amount</itemvalue> (Brutto € <itemvalue>_amount_brutto</it
<cdtr.name>...</cdtr.name> <cdtr.name>...</cdtr.name>
<invoice.number>...</invoice.number> <invoice.number>...</invoice.number>
<invoice.date>2024-12-31</invoice.date> <invoice.date>2024-12-31</invoice.date>
<payment.date>2024-12-31</payment.date> <invoice.duedate>2024-12-31</invoice.duedate>
<invoice.total type="double">1234.00</invoice.total> <invoice.total type="double">1234.00</invoice.total>
<cdtr.iban>...</cdtr.iban> <cdtr.iban>...</cdtr.iban>
<cdtr.bic>...</cdtr.bic> <cdtr.bic>...</cdtr.bic>
@ -703,9 +703,9 @@ Transfer the individual invoice data to the XML tags, taking into account the fo
- Total ==> "invoice.total" (in EUR or if not available in USD or PLN) - Total ==> "invoice.total" (in EUR or if not available in USD or PLN)
- IBAN ==> "cdtr.iban" - IBAN ==> "cdtr.iban"
- BIC or SWIFT ==> "cdtr.bic" - BIC or SWIFT ==> "cdtr.bic"
- Payment date / Due date ==> "payment.date" - Payment date / Due date ==> "invoice.duedate"
Note: Output only the XML object! Don't add explanations or comments. Use only the XML structure specified in this example and do not create any other XML tags. If you don't have data for some fields, leave the corresponding XML tags blank. Format date values (invoice.date, payment.date) into the ISO 8601 format (YYYY-MM-DD). Format numbers and amounts (type="double") according to ISO 4217. Note: Output only the XML object! Don't add explanations or comments. Use only the XML structure specified in this example and do not create any other XML tags. If you don't have data for some fields, leave the corresponding XML tags blank. Format date values (invoice.date, invoice.duedate) into the ISO 8601 format (YYYY-MM-DD). Format numbers and amounts (type="double") according to ISO 4217.
<<EXAMPLES_XML>> <<EXAMPLES_XML>>
@ -908,7 +908,7 @@ Note: Output only the XML object! Don't add explanations or comments. Use only t
Extract also the company name and the language the invoice is written in. Extract also the company name and the language the invoice is written in.
Note: The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. Note: The company name is the name of the company that issued the invoice document and not the name of the recipient. As a rule, it is not Alexander Global Logistics either. The company name is often at the beginning or end of the invoice document.
Output the infromation as one XML object that has the following structure: Output the infromation as one XML object that has the following structure:
@ -1031,7 +1031,7 @@ Note: Do not generate any other information instead of the XML object. Do not ge
<bpmn2:documentation id="documentation_8puQcA" open-bpmn:file-link="file://prompts/invoice-summarize-en.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <bpmn2:documentation id="documentation_8puQcA" open-bpmn:file-link="file://prompts/invoice-summarize-en.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<PromptDefinition> <PromptDefinition>
<prompt_options>{"n_predict": 4096, "temperature": 0}</prompt_options> <prompt_options>{"n_predict": 4096, "temperature": 0}</prompt_options>
<prompt><![CDATA[[INST]You are a clerk at the logistic company 'Alexander Global Logistics'. Your task is to check incoming invoices. [/INST] <prompt><![CDATA[[INST]You are an employee at the logistic company 'Alexander Global Logistics'. Your job is to check incoming invoice documents and forward them internally to employees. [/INST]
<FILECONTEXT>^.+\.([pP][dD][fF])$</FILECONTEXT> <FILECONTEXT>^.+\.([pP][dD][fF])$</FILECONTEXT>
@ -1039,17 +1039,18 @@ Note: Do not generate any other information instead of the XML object. Do not ge
Summarize the data from this invoice document: Summarize the data from this invoice document:
- Company information - Vendor information
- General Billing data - General Billing data
- Invoice total information - Invoice total information
- Payment summary - Payment summary (including bank data)
- Invoice items - Invoice items
The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. Note: The vendor information refers to the sender of the invoice. The company name is the name of the company that issued the invoice document and not the name of the recipient. As a rule, it is not Alexander Global Logistics either. The company name is often at the beginning or end of the invoice document.
Summarize the invoice lines in a table.
Use only the default values and do not perform any calculations, summing or changes to these values yourself. Format numbers and amounts according to ISO 4217. Use only the default values and do not perform any calculations, summing or changes to these values yourself. Format numbers and amounts according to ISO 4217.
If possible summarize the invoice lines in a table.
[/INST] [/INST]
]]]]><![CDATA[> ]]]]><![CDATA[>
</prompt> </prompt>

View file

@ -13,7 +13,7 @@
Extract also the company name and the language the invoice is written in. Extract also the company name and the language the invoice is written in.
Note: The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. Note: The company name is the name of the company that issued the invoice document and not the name of the recipient. As a rule, it is not Alexander Global Logistics either. The company name is often at the beginning or end of the invoice document.
Output the infromation as one XML object that has the following structure: Output the infromation as one XML object that has the following structure:

View file

@ -11,7 +11,7 @@
<cdtr.name>...</cdtr.name> <cdtr.name>...</cdtr.name>
<invoice.number>...</invoice.number> <invoice.number>...</invoice.number>
<invoice.date>2024-12-31</invoice.date> <invoice.date>2024-12-31</invoice.date>
<payment.date>2024-12-31</payment.date> <invoice.duedate>2024-12-31</invoice.duedate>
<invoice.total type="double">1234.00</invoice.total> <invoice.total type="double">1234.00</invoice.total>
<cdtr.iban>...</cdtr.iban> <cdtr.iban>...</cdtr.iban>
<cdtr.bic>...</cdtr.bic> <cdtr.bic>...</cdtr.bic>
@ -25,9 +25,9 @@ Transfer the individual invoice data to the XML tags, taking into account the fo
- Total ==> "invoice.total" (in EUR or if not available in USD or PLN) - Total ==> "invoice.total" (in EUR or if not available in USD or PLN)
- IBAN ==> "cdtr.iban" - IBAN ==> "cdtr.iban"
- BIC or SWIFT ==> "cdtr.bic" - BIC or SWIFT ==> "cdtr.bic"
- Payment date / Due date ==> "payment.date" - Payment date / Due date ==> "invoice.duedate"
Note: Output only the XML object! Don't add explanations or comments. Use only the XML structure specified in this example and do not create any other XML tags. If you don't have data for some fields, leave the corresponding XML tags blank. Format date values (invoice.date, payment.date) into the ISO 8601 format (YYYY-MM-DD). Format numbers and amounts (type="double") according to ISO 4217. Note: Output only the XML object! Don't add explanations or comments. Use only the XML structure specified in this example and do not create any other XML tags. If you don't have data for some fields, leave the corresponding XML tags blank. Format date values (invoice.date, invoice.duedate) into the ISO 8601 format (YYYY-MM-DD). Format numbers and amounts (type="double") according to ISO 4217.
<<EXAMPLES_XML>> <<EXAMPLES_XML>>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<PromptDefinition> <PromptDefinition>
<prompt_options>{"n_predict": 4096, "temperature": 0}</prompt_options> <prompt_options>{"n_predict": 4096, "temperature": 0}</prompt_options>
<prompt><![CDATA[[INST]You are a clerk at the logistic company 'Alexander Global Logistics'. Your task is to check incoming invoices. [/INST] <prompt><![CDATA[[INST]You are an employee at the logistic company 'Alexander Global Logistics'. Your job is to check incoming invoice documents and forward them internally to employees. [/INST]
<FILECONTEXT>^.+\.([pP][dD][fF])$</FILECONTEXT> <FILECONTEXT>^.+\.([pP][dD][fF])$</FILECONTEXT>
@ -9,17 +9,18 @@
Summarize the data from this invoice document: Summarize the data from this invoice document:
- Company information - Vendor information
- General Billing data - General Billing data
- Invoice total information - Invoice total information
- Payment summary - Payment summary (including bank data)
- Invoice items - Invoice items
The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. Note: The vendor information refers to the sender of the invoice. The company name is the name of the company that issued the invoice document and not the name of the recipient. As a rule, it is not Alexander Global Logistics either. The company name is often at the beginning or end of the invoice document.
Summarize the invoice lines in a table.
Use only the default values and do not perform any calculations, summing or changes to these values yourself. Format numbers and amounts according to ISO 4217. Use only the default values and do not perform any calculations, summing or changes to these values yourself. Format numbers and amounts according to ISO 4217.
If possible summarize the invoice lines in a table.
[/INST] [/INST]
]]> ]]>
</prompt> </prompt>

View file

@ -5489,7 +5489,7 @@ result.isValid=true;
<imixs:value><![CDATA[2]]></imixs:value> <imixs:value><![CDATA[2]]></imixs:value>
</imixs:item> </imixs:item>
<imixs:item name="keypublicresult" type="xs:string"> <imixs:item name="keypublicresult" type="xs:string">
<imixs:value><![CDATA[1]]></imixs:value> <imixs:value><![CDATA[0]]></imixs:value>
</imixs:item> </imixs:item>
<imixs:item name="keylogdateformat" type="xs:string"> <imixs:item name="keylogdateformat" type="xs:string">
<imixs:value><![CDATA[2]]></imixs:value> <imixs:value><![CDATA[2]]></imixs:value>