# Enhancing News Articles: Automatic SEO Linked Data Injection for Semantic Web Integration
## 3 Methodology  
Our methodology, depicted in the flowchart in Figure 1, enables the inference of linked data from the entire web page content without requiring prior knowledge of the structure of the source HTML code. The results produced are comparable to those generated by web page authors.  
In Figure 1, the flowchart illustrates the workflow used to process news articles for integration into the Semantic Web. The process begins with exporting top news articles from Google News, followed by a check to verify if each article includes a JSON-LD (linked data JSON) object. Articles lacking JSON-LD are marked as \"rejected\", while those with JSON-LD continue to the next step as \"Approved Articles\". Subsequently, these approved articles are evaluated for their \"Rich Text\" quality, meaning they have sufficient structure for further processing. Articles failing this check are rejected, while those passing it are finalized as \"100% Rich Text articles\". Additional steps are applied to add or remove JSON-LD where necessary, ensuring the structured readability and integration of news content.  
To perform the analysis, we utilized Google News as our source of articles, which already possesses linked data JSON objects (JSON-LD) attached to each page, hereafter referred to as the original JSON-LD. Our approach employs a general data extraction method that applies pattern mining to news sites, as published in [34]. The pattern miner scrapes the title and body of the news article to extract the plain text content. The text with the largest font size on the page is identified as the title, while the largest div element (by character length) is designated as the body, as illustrated in Figure 2.  
Furthermore, we extended our method from [34] to clean the title and article body after scraping, removing unrelated words, links, images, and advertisements using OpenAI's GPT-3 API [35]. Specifically, GPT-3 was employed to identify and filter out irrelevant elements. This includes extraneous words or phrases unrelated to the core news content, promotional links and advertisements, references to images, and other non-essential elements. This process ensures that the structured data focus exclusively on the relevant article information, facilitating seamless integration into the Semantic Web.  
Utilizing this methodology, we extract the most important properties of the JSON-LD object, such as the title, article body, images, and URLs, thus creating a new JSON  
Figure 1: Article processing workflow.  
+++ ==ERROR: No output for this page==
object--the generated JSON-LD. To verify our results, we compare the generated JSON-LD with the original using two distinct methods:  
++  
This allows us to quantify the differences in content distribution between the original JSON-LD and the generated JSON-LD.  
Additionally, we can measure the entropy \(H\) of the generated content using the following equation:  
\[H(X)=-\sum_{i}p(x_{i})\log(p(x_{i})) \tag{3}\]  
where \(p(x_{i})\) represents the probability of the occurrence of each unique word \(x_{i}\) in the content.  
The methodology can be succinctly represented in five steps:  
1. **Extraction of News Articles:** gather news web pages containing the original JSON-LD object.
2. **Analyze/Remove JSON-LD:** remove the original JSON-LD object and save it externally for comparison.
3. **Generate and Inject JSON-LD:** use pattern mining to generate a new JSON-LD object and inject it into the original page to replace the original.
4. **Check JSON-LD:** validate the new page with the injected JSON-LD using the Rich Results Checker.
5. **Check the JSON-LD Content:** compare the content word by word to compute a similarity score between properties.  
The following pseudocode outlines the algorithms utilized in our methodology for extracting and generating JSON-LD annotations.