Analyzing Sentiment in New York Times Articles Using TensorFlow
In a recent study, the specific sentiment analysis of New York Times (NYT) article abstracts during the first year of each of the past four presidents' administrations, with a particular focus on the Biden administration, was examined. Although direct sentiment analysis of NYT abstracts for the Biden administration is not readily available, some key points have been identified that offer insight into the tone and sentiment in coverage during Biden's first year compared to prior administrations.
During the early stages of the Biden administration, NYT coverage indicated that Biden’s actions emphasized racial equality more than any president since Lyndon B. Johnson. The administration started with high approval ratings (over 50%) but faced significant challenges including the Afghanistan withdrawal, high inflation, and rising gas prices, which contributed to lower approval later in the term. This mixed but initially positive framing suggests a sentiment that started hopeful but became more critical over time.
Biden oversaw a strong economic recovery post-COVID-19, noted as the strongest among G7 nations and a historic record in the U.S., with over 16 million new jobs created in his term. However, media may have highlighted the stagnation of median wages and growing wealth inequality, indicating a nuanced sentiment blending economic optimism with caution about equitable growth.
Compared to Trump, Obama, or Bush, no direct sentiment comparison with these previous presidents is provided. However, the literature notes that Trump’s disruptive impact on alliances and NATO relationships reflected more contentious and perhaps negatively toned media coverage in his early years. Biden’s doctrine prioritizing alliance maintenance and multilateralism was typically viewed more favorably in media focused on international relations.
The Biden administration’s approach to digital market regulation and consumer protection marked a paradigm shift at the FTC, moving beyond mere disclosures to substantive protections. This proactive stance might be reflected in NYT articles as a positive, forward-looking development based on the agency’s aggressive actions on data abuses.
In summary, while exact sentiment scores or analysis of NYT abstracts are not available, the sentiment during Biden’s first year likely began positively due to social justice and economic recovery efforts but was tempered by challenges such as inflation and foreign policy setbacks. Compared to the more disruptive tone associated with Trump’s early term, Biden's coverage probably reflected a more measured, consensus-driven sentiment with cautious optimism. This contrasts with prior administrations where early coverage may have varied based on the prevailing political and economic context.
For those requiring detailed sentiment analysis data, specialized media analysis tools or datasets focusing on NYT abstracts would be necessary to quantitatively compare these administrations’ first-year coverage sentiment. The study was performed using the NYT API and the TextBlob library for sentiment analysis. However, it was found that TextBlob achieved only 62% accuracy, so the author trained their own sentiment analysis model using TensorFlow to improve accuracy. The model was trained on a dataset of 1.6MM labeled tweets and achieved 79% accuracy on the test dataset.
The author intends to perform additional analyses with the data, including looking at most commonly used words, to gain a better understanding of the results. The model was trained, and the results were evaluated and visualized with a confusion matrix. The news was generally most positive during Trump’s first year, with 34% positive sentiment overall, while the news was most negative during Bush's first year in office, with only 25% positive sentiment overall and 28% positive in news abstracts that directly mention "Bush".
The author noticed that TextBlob was inaccurate, so they trained their own sentiment analysis model using TensorFlow. The model was compiled using the Adam optimizer, with loss calculated using BinaryCrossentropy and accuracy calculated using BinaryAccuracy with a 0.5 threshold. The model has two hidden layers with 16 and 8 nodes, respectively, and an output layer with 1 node. The hidden layers use the ReLU activation function, and the output layer uses the sigmoid activation function. The model was created using the Sequential model from keras, with word embedding provided by tensorflow-hub.
In conclusion, the sentiment analysis of NYT coverage during the first year of each recent president's administration offers valuable insights into the tone and sentiment of the media during these periods. While the exact sentiment scores or analysis of NYT abstracts for the Biden administration are not readily available, the sentiment during Biden’s first year likely began positively due to social justice and economic recovery efforts but was tempered by challenges such as inflation and foreign policy setbacks. Compared to the more disruptive tone associated with Trump’s early term, Biden's coverage probably reflected a more measured, consensus-driven sentiment with cautious optimism. This contrasts with prior administrations where early coverage may have varied based on the prevailing political and economic context.
- The administration's proactive stance towards digital market regulation under the Biden presidency may be reflected in New York Times (NYT) articles as a positive, forward-looking development, showcasing the intersection of data-and-cloud-computing and technology.
- The literature suggests that Trump’s contentious and negative tone in media coverage during his early years was markedly different from the more measured, consensus-driven sentiment present in Biden's term, indicating a subtle shift in the overall sentiment tone influenced by artificial-intelligence and technology in media analysis.