May 4, 2011

How to split articles and submit into openAI under its limit? | 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

No permission to create posts
sp_TopicIcon
How to split articles and submit into openAI under its limit?
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
April 12, 2024
2:24 pm
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline

Hi dev, so I got into issue. I need to translate full articles using GPT4. But articles are too big to get translated in one assignment. So solution would be automated article splitting based on paragraph amount (since word limitation would cut articles in random places, losing their context). After article is splitted into 2-3 parts, now it can be submited into GPT4 for translation. And after all parts are translated, they are back into one article and posted.

How can I do it in CyberSEO?

April 12, 2024
3:06 pm
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Yes, this method really works and some CyberSEO Pro users do it using Login to see this link. The problem is that this method is not a universal solution, because not every HTML document can be split into paragraphs. That’s why this can’t be implemented as a standard option. But again, as a custom solution for some special cases, it can be done via a simple PHP snippet.

April 12, 2024
3:16 pm
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline

Okay, thanks for quick reply!

How would you solve this issue? If the articles are too big for any GPT.

April 12, 2024
3:20 pm
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

This code will do the trick when placed in the “Custom PHP code” box in the “Expert” tab of your feed settings.

Login to see the code

April 12, 2024
3:45 pm
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline

Thanks, I will try and let you know.

April 12, 2024
11:32 pm
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

You can also try replacing gpt-4-1106-preview with gpt-3.5-turbo, which is faster and cheaper. It may also work well with your languages.

April 13, 2024
9:02 am
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline

Thanks for suggestion. I prefer GPT4 models since quality is better.

Script is working, only issue I have is that Execution time is not enough. Browser is loading first 4 minutes and then stops loading and just shows this: Syndicating Login to see this link

I tried making execution time on server 1800 and in plugin, but does not help.

Syndicator LOG show it is executing till it creates image as it should. But then nothing happens – no posting part.

What could be issue?

April 13, 2024
1:19 pm
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

The value you set in CyberSEO Pro may not work if your maximum execution time is limited by the server config. Here is a quote from Login to see this link:

The default PHP execution time limit at your server is usually set to 30 seconds only. On the other hand, some content sources like Amazon product search pages, Facebook pages, Instagram pages or those feeds that use AI services, require sufficiently more time to process. If the default time limit exceeded, the server aborts the CyberSEO Pro execution and the contingent just not get added. Use this “Max execution time” to set the PHP execution time necessary to process all your feeds.

⚠️ When working with PHP, it’s important to understand that setting the maximum execution time of a script through the script itself may not always be effective, especially in shared hosting environments. Many shared hosting providers enforce their own limits on script execution time, which can override any settings specified within your PHP code. Consequently, your attempts to extend the execution time through the script may not yield the expected results.

Moreover, even if there aren’t explicit restrictions from the hosting provider, you might encounter server-level configuration requirements. To effectively change the execution time limit, you often need to manually edit the ‘php.ini’ file, which is the central configuration file for PHP. In this file, look for the line that reads max_execution_time = 30. The number here represents the time limit in seconds. You can adjust this number to increase the execution time limit. For example, setting it to max_execution_time = 300 will allow scripts to run for up to 300 seconds.

However, access to the “php.ini” file is not always available, particularly on shared hosting platforms, which means you might not be able to make this change depending on your hosting situation. It’s important to be aware of the limitations of your hosting environment when trying to adjust PHP execution time settings.

April 15, 2024
9:59 am
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline

I tried to contact hosting , changed execution time to 30 minutes, and even hosting tried to change it to 30 minutes. But still same thing. Take a look. It just stops.

Login to see the quote

Cracks at the Corners of the Mouth: Those painful cracks that look like line segments could actually be signs of iron deficiency anemia.

April 15, 2024
10:23 am
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline
10sp_Permalink sp_Print
0

There are no errors in your log. You are making a long series of GPT requests, so it appears that the script was simply stopped by your server because it ran out of time. Here are the instructions on how to fix it: Login to see this link

April 15, 2024
10:24 am
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline
11sp_Permalink sp_Print
0

Okay, then I will push hosting to investigate. Since they said it should be 30 minutes, lol. Thanks

April 15, 2024
10:25 am
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline
12sp_Permalink sp_Print
0

If you have a chance to test run this one with PHP code you have provided, please try. 

Feed:

Login to see this link

April 15, 2024
10:25 am
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline
13sp_Permalink sp_Print
0

Note that any shared hosting allows you to set a maximum execution time of 30 minutes. This is not a limitation of CyberSEO Pro. This is a limitation of your hosting provider.

April 15, 2024
10:29 am
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline
14sp_Permalink sp_Print
0

mediasf1231 said
If you have a chance to test run this one with PHP code you have provided, please try. 
Feed:
Login to see this link

The actual feed URL has no effect on the result. In my case, all scripts run on dedicated servers, so there is no time limit that can’t be set there – 10 minutes, 30 minutes, or even 30 days. The script will be executed anyway.

April 15, 2024
10:34 am
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

I would suggest you to check your server log. If there was an error in CyberSEO Pro, it will be shown there. If the script was stopped by the server when the execution time was exceeded, it will be shown there. Once you see the actual error message, we can start looking for ways to fix the problem.

Alternatively, you can simply reduce the total number of GPT requests needed to generate an article to say 2-3 and check. If the article is generated, then the problem is definitely caused by the max execution time limit.

April 15, 2024
10:37 am
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline
16sp_Permalink sp_Print
0

CyberSEO said
I would suggest you to check your server log. If there was an error in CyberSEO Pro, it will be shown there. If the script was stopped by the server when the execution time was exceeded, it will be shown there. Once you see the actual error message, we can start looking for ways to fix the problem.

Alternatively, you can simply reduce the total number of GPT requests needed to generate an article to say 2-3 and check. If the article is generated, then the problem is definitely caused by the max execution time limit.  

Great suggestion, Thank You! I will.

April 15, 2024
10:56 am
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

As mentioned above, GPT-3.5 Turbo takes much less time to process your requests than GPT-4 Turbo. Consider using a faster, less expensive model instead. GPT-3.5 Turbo should work properly with Spanish.

April 15, 2024
11:50 am
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline

CyberSEO said
As mentioned above, GPT-3.5 Turbo takes much less time to process your requests than GPT-4 Turbo. Consider using a faster, less expensive model instead. GPT-3.5 Turbo should work properly with Spanish.  

Ok seems like PHP got successfully executed. Though for some reason it stopped after saving image. This time it executed almost 8 minutes. Do you think its still problem with execution time? 

Login to see the quote

P.S. image got saved and I can see it on my server.

April 15, 2024
12:07 pm
Avatar
CyberSEO
Admin
Forum Posts: 3683
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

The server may run out of time while saving the image. Since it also generates thumbnails and (depending on your settings) may add the image to your media library, the process also takes time.

This also can be a problem with the Login to see this link

The link above has recommendations for solving this problem. In some cases, even switching your PHP mode from FastCGI to CGI may help, since it’s a server-related issue.

Alternatively, I would suggest disabling this setting (if enabled): Login to see this link, because it uses getimagesize() to determine the size of the image.

Also note that getimagesize() uses a lot of your server’s memory for it’s execution because it loads the image into your server’s memory in raw (uncompressed) format. So make sure your PHP processes have enough dedicated RAM.

April 15, 2024
12:59 pm
Avatar
mediasf1231
Member
Members
Forum Posts: 26
Member Since:
April 9, 2024
sp_UserOfflineSmall Offline

CyberSEO said
The server may run out of time while saving the image. Since it also generates thumbnails and (depending on your settings) may add the image to your media library, the process also takes time.

This also can be a problem with the Login to see this link

The link above has recommendations for solving this problem. In some cases, even switching your PHP mode from FastCGI to CGI may help, since it’s a server-related issue.

Alternatively, I would suggest disabling this setting (if enabled): Login to see this link, because it uses getimagesize() to determine the size of the image.

Also note that getimagesize() uses a lot of your server’s memory for it’s execution because it loads the image into your server’s memory in raw (uncompressed) format. So make sure your PHP processes have enough dedicated RAM.  

Issue with execution time resolved using htaccess.

Login to see the code

Post got posted after this. 

Now I have another issue. :D

Login to see the code

No permission to create posts
Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
5 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 64

Freedom: 61

MediFormatica: 49

B8europe: 47

saviulisse67: 45

Member Stats:

Guest Posters: 338

Members: 2648

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1540

Posts: 7770

Newest Members:

r94alves, adammostynsmith1987, ionut.lumezanu, ndorado21, tobiasdoerr.1, ahmed.alarytech

Administrators: CyberSEO: 3683