HyeonseoNam / auto-classifier

Auto classification plugin for Obsidian using ChatGPT.
MIT License
88 stars 11 forks source link

Add summary into YAML field summary #8

Open dxcore35 opened 1 year ago

dxcore35 commented 1 year ago

Can you expand functionality to extract whatever user define in settings of the plugin and then insert or replace the output text into YAML? I tried it with current plugin but it doesn't work!

HyeonseoNam commented 1 year ago

Hi, @dxcore35,

Can you provide more detailed usage instructions regarding what you are referring to? You mean the YAML output type? If then, it should be possible to expand it in the near future.

dxcore35 commented 1 year ago
---
date: 2023-02-03
summary: 

---

This is YAML header.

I would like that there is command that will take all the note and create the summary and add it to field summary:

HyeonseoNam commented 1 year ago

Oh, that is a really good usage example. Fortunately, you can already use that way !

Setting:

image

Note that I changed the custom prompt template to this:

Summarize this content in 100 characters:
"""
{{input}}
"""
Answer format is JSON {reliability:0~1, output:content}. 
Even if you are not sure, qualify the reliability and recommend a proper category.

and run Classify tag from Note Content (if note content is too long, it may cause an error) or Classify tag from Selected Area

Result example:

image

dxcore35 commented 1 year ago

It is crazy. I used same prompt as you but is is giving me very bad summarization. Sometimes it is just taking what is in the note and put it there, no summarization.

What is this?

HyeonseoNam commented 1 year ago

This prompt is more reliable.

Summarize this content in 3 sentences:
"""
{{input}}
"""
Answer format is JSON {reliability:0~1, output:summarized}. 
  • Answer format is JSON {reliability:0~1, output:content}.

-> This is intended to force the output of chatGPT in JSON format for postprocessing in plugin logic. If the reliability is too low, it will be treated as an error. Only the value after output: is needed.

  • Even if you are not sure, qualify the reliability and recommend a proper category.

-> I made a mistake. If not the classification case, it's better to remove it.

dxcore35 commented 1 year ago

Thank you. It is much better. But he is splitting lines in YAML which is not optimal.