Skip to content
New issue

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

Correspondant given is more like a summary - Fails to update with "Ensure this field has no more than 128 characters." #231

Open
WhiteSockedDancer opened this issue Feb 12, 2025 · 4 comments

Comments

@WhiteSockedDancer
Copy link

WhiteSockedDancer commented Feb 12, 2025

I'm new to paperless-gpt and trying it out.

Running it with

Ollama
Model: deepseek-r1:14b
Tokens: 2000

Prompt for correspondents:

I will provide you with the content of a document. Your task is to suggest a correspondent that is most relevant to the document.

Correspondents are the senders of documents that reach you. In the other direction, correspondents are the recipients of documents that you send.
In Paperless-ngx we can imagine correspondents as virtual drawers in which all documents of a person or company are stored. With just one click, we can find all the documents assigned to a specific correspondent.
Try to suggest a correspondent, either from the example list or come up with a new correspondent.

Respond only with a correspondent, without any additional information! Important!

Be sure to choose a correspondent that is most relevant to the document.
Try to avoid any legal or financial suffixes like "GmbH" or "AG" in the correspondent name. For example use "Microsoft" instead of "Microsoft Ireland Operations Limited" or "Amazon" instead of "Amazon EU S.a.r.l.".

If you can't find a suitable correspondent, you can respond with "Unknown".

Example Correspondents:
{{.AvailableCorrespondents | join ", "}}

List of Correspondents with Blacklisted Names. Please avoid these correspondents or variations of their names:
{{.BlackList | join ", "}}

Title of the document:
{{.Title}}

The content is likely in {{.Language}}.

Document Content:
{{.Content}}

I get the following in the log for example:

time="2025-02-12T15:57:58Z" level=error msg="Error creating/getting correspondent with name The provided document is an invitation to the 15th baptism festival (Tauffest) of the Evangelische Pfarrgemeinde West Freiburg, scheduled for May 29, 2025. The event will take place at 10:30 AM in the rose garden of the Eschholzpark. Below is a detailed summary of the document:\n\n---\n\n**Title:** \n**15. Tauffest der Evangelischen Pfarrgemeinde West Freiburg am 29. Mai 2025**\n\n---\n\n**Date and Time:** \nThursday, May 29, 2025, at 10:30 AM\n\n**Location:** \nEschholzpark (specifically in the rose garden)\n\n---\n\n**Participants in the Baptism Service:** \n- **Pfarrer Ulrich Bayer** \n- **Pfarrerin Kristina Lallathin** \n- **Pfarrerin Kathrin Stetter** \n- **Pfarrerin Kim Thiem**\n\n**Musical Leadership:** \n- **Kantorin Laura Skarnulyte** (choir director) \n- **Johannes Hammar** (trumpet choir leader)\n\n---\n\n**Event Details:** \nThe event will feature a festive family worship service with baptism stations, followed by a communal lunch and a cake buffet. There will also be a fun program for the children.\n\n---\n\n**Invitation:** \nThe document invites families to consider this event as an opportunity to baptize their child in a relaxed and joyful atmosphere. The organizers emphasize that there are no costs involved, though they welcome contributions of cakes for the buffet.\n\n---\n\n**Contact Information:** \n- **Address:** Evangelische Pfarrgemeinde West, Fehrenbachallee 50, 79106 Freiburg \n- **Phone:** 0761-276642 \n- **Email:** west.freiburg@kbz.ekiba.de \n\n---\n\n**Next Steps:** \nFamilies interested in participating are encouraged to contact the church. After registration, the team will follow up with further details and schedule a personal meeting to discuss the baptism.\n\n---\n\n**Closing Statement:** \nThe document concludes with an expression of excitement for a colorful and joyful celebration, signed by the team of the Evangelische Pfarrgemeinde West Freiburg.\n\n---\n\nThis summary captures all the essential details of the event, including its purpose, participants, logistics, and contact information.: error creating correspondent: 400, {\"name\":[\"Ensure this field has no more than 128 characters.\"]}\n"

What i expect:

Evangelischen Pfarrgemeinde West Freiburg

I'm very new to local LLMS, prompting and Token size. Should i choose another model, less tokens or is my prompt wrong? Does it even take the prompt?

@icereed
Copy link
Owner

icereed commented Feb 12, 2025

Hmmm… it’s not always easy to tame local models. You could try to add the following to the very end of the prompt:

---
Now write out the correspondent only without any further information. 

@WhiteSockedDancer
Copy link
Author

I will try that this evening. Thanks for the response.

@Andurilll
Copy link

Andurilll commented Feb 13, 2025

I also tried with deepseek and failed. I guess it is because how the model talks to itself.

I had okay results with: (in German)

  • qwen2.5:7b
  • mistral-nemo:12b-instruct-2407-q4_0

@WhiteSockedDancer
Copy link
Author

WhiteSockedDancer commented Feb 23, 2025

I also tried it with qwen2.5: 14b. Same effect.

Then i added the lines:


Now write out the correspondent only without any further information.

It didnt help.

I got it under control with the following prompt:

I will provide you with the content of a document. Your task is to suggest a correspondent that is most relevant to the document.

Correspondents are the senders of documents that reach you. In the other direction, correspondents are the recipients of documents that you send.
In Paperless-ngx we can imagine correspondents as virtual drawers in which all documents of a person or company are stored. With just one click, we can find all the documents assigned to a specific correspondent.
Try to suggest a correspondent, either from the example list or come up with a new correspondent.

Be sure to choose a correspondent that is most relevant to the document.
Try to use one of the example Correspondents if they fit the document.

Example Correspondents:
{{.AvailableCorrespondents | join ", "}}

Title of the document:
{{.Title}}

The content is likely in {{.Language}}.

Document Content:
{{.Content}}

---
- Try to avoid any legal or financial suffixes like "GmbH" or "AG" in the correspondent name. For example use "Microsoft" instead of "Microsoft Ireland Operations Limited" or "Amazon" instead of "Amazon EU S.a.r.l.".
- The correspondent should not contain any adresses 
- If you can't find a suitable correspondent, you can respond with "Unknown".
- IMPORTANT! Write out the correspondent only without any further information or explanation! 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants