May 4, 2011

convert to block | CyberSEO Pro | Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_TopicIcon
convert to block
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
May 10, 2024
10:19 pm
Avatar
JoJo
Member
Members
Forum Posts: 17
Member Since:
December 5, 2022
sp_UserOfflineSmall Offline

Hi,

How could I convert generated texts to block?

ty

May 10, 2024
10:38 pm
Avatar
CyberSEO
Admin
Forum Posts: 3909
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

To convert AI-generated text to the Gutenberg block format, you can directly instruct the AI model to include Gutenberg block tags in its output. The Gutenberg editor in WordPress uses specific comment tags to denote different types of blocks. For a paragraph block, these tags are <!-- wp:paragraph --> and <!-- /wp:paragraph -->.

You can format the prompt for your AI model to generate text with each paragraph enclosed between these tags. For example, you can do it like this, because OpenAI GPT-4 knows the Gutenberg format:

Login to see the quote

This way, the text produced by the AI is already correctly formatted for insertion as blocks in the Gutenberg editor.

August 20, 2024
6:44 pm
Avatar
novaretis
Member
Members
Forum Posts: 14
Member Since:
January 6, 2023
sp_UserOfflineSmall Offline

CyberSEO said
To convert AI-generated text to the Gutenberg block format, you can directly instruct the AI model to include Gutenberg block tags in its output. The Gutenberg editor in WordPress uses specific comment tags to denote different types of blocks. For a paragraph block, these tags are <!-- wp:paragraph --> and <!-- /wp:paragraph -->.

You can format the prompt for your AI model to generate text with each paragraph enclosed between these tags. For example, you can do it like this, because OpenAI GPT-4 knows the Gutenberg format:

Login to see the quote

This way, the text produced by the AI is already correctly formatted for insertion as blocks in the Gutenberg editor.  

I try to do this, but this is the result, why?

Proteste contro Harley-Davidson negli Stati Uniti

<!–– wp:paragraph ––>
Negli Stati Uniti, Harley-Davidson si trova attualmente nel mirino delle critiche e delle proteste, innescate dalla decisione di trasferire la produzione di alcuni modelli chiave all'estero. Questa scelta ha suscitato forti reazioni da parte di lavoratori e sindacati, i quali avvertono che questo passo rappresenta una mancanza di rispetto verso la tradizione e il patrimonio dell’azienda come icona americana. La decisione, annunciata dal CEO Jochen Zeits, va a colpire in particolare i lavoratori del Wisconsin e della Pennsylvania, che vedono questa mossa come un tradimento delle promesse fatte.
<!–– /wp:paragraph ––>

<!–– wp:paragraph ––>
La linea di produzione degli innovativi modelli Revolution Max, tra cui il Pan America e lo Sportster S, è al centro di queste proteste. Gli operai temono non solo per la loro sicurezza lavorativa, ma anche per il futuro dell'azienda stessa che, nel panorama attuale, sembra allontanarsi dalle sue radici americane. È un affronto che molti considerano un “calcio nei denti” per chi ha dedicato anni della propria vita a costruire l'heritage Harley-Davidson.
<!–– /wp:paragraph ––>

August 20, 2024
6:46 pm
Avatar
novaretis
Member
Members
Forum Posts: 14
Member Since:
January 6, 2023
sp_UserOfflineSmall Offline

this is my syndication log:

Login to see the quote

August 20, 2024
6:58 pm
Avatar
CyberSEO
Admin
Forum Posts: 3909
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Do you mean that the Gutenberg markup ... was generated as part of the text, but not as HTML comments?

Can I see your exact prompt?

To ensure the AI model, especially a less advanced one like GPT-4o mini, generates Gutenberg block markup correctly, you need to be very precise with your prompt. Therefore, it's important to make sure the model outputs the markup as part of the text block in HTML format, not as a full HTML document or in Markdown.

Make sure your prompt explicitly instructs the model to output the Gutenberg block tags as part of a text block in HTML. For example:

Login to see the quote

Avoid misinterpreting the model, because sometimes models like the GPT-4o mini can "hallucinate" or misinterpret instructions, especially if the prompt is vague. Therefore, it's important to use clear and simple language in your prompt, and keep the temperature setting low (around 0.3-0.4) to reduce randomness and keep the model focused.

Before using a prompt with the CyberSEO Pro plugin, always test it in Login to see this link. Select the same AI model (GPT-4o mini in your case) and configure it with the same parameters you want to use in the plugin. This will help you verify that the model produces the desired output before it's used in production, because testing your commands first will help reduce these risks.

August 20, 2024
7:36 pm
Avatar
novaretis
Member
Members
Forum Posts: 14
Member Since:
January 6, 2023
sp_UserOfflineSmall Offline

of course:

Login to see the code

August 20, 2024
7:48 pm
Avatar
CyberSEO
Admin
Forum Posts: 3909
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Thanks for sharing your prompt. It looks like the model may be interpreting the prompt in a way that doesn't quite match what you need, possibly defaulting to Markdown formatting, which is a common problem for GPT-4o mini.

Here's an improved version of your prompt that may help to resolve the formatting issues with Gutenberg:

Login to see the code

Keep in mind that the AI model may still interpret things differently, especially a less advanced model like GPT-4o mini. Always test your prompts directly in OpenAI's Playground with the same model and settings you plan to use in the plugin. This way you can verify the output before using it in production, as unexpected results can still happen, and it's better to catch them early.

If nothing helps, consider using the GPT-4o engine (openai-gpt-4o), which will not fail at this task.

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
12 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 68

Freedom: 61

Pandermos: 54

MediFormatica: 49

B8europe: 48

Member Stats:

Guest Posters: 337

Members: 2816

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1625

Posts: 8271

Newest Members:

jeremyboucher, lthompson2709, MAC, duty3canada, backlinkmorocco, dmitrypehovskiwork

Administrators: CyberSEO: 3909