Sign up to save tools and stay up to date with the latest in AI
bg
bg
1

Extracting Hacker News Book Recommendations with the ChatGPT API

Oct 04, 2023 - blog.reyem.dev
The author of the article analyzed Hacker News (HN) book recommendation threads using the GPT API to categorize data and extract book titles, authors, and URLs. The top three most recommended books were "Structure and Interpretation of Computer Programs" by Abelson and Sussman, "Gödel, Escher, Bach" by Douglas Hofstadter, and "How to Win Friends and Influence People" by Dale Carnegie. The author also discovered that even with a temperature of 0, GPT’s results vary from call to call, and that processing 57k comments cost about $40 using the gpt 3.5 turbo API.

The author also shared the raw data produced by GPT, sorted by title, for others who might find it interesting to analyze the results. They also noted that they had added Amazon affiliate links to Amazon URLs in the tables, mainly as a learning exercise. The author also shared some challenges faced during the project, such as the API not returning valid JSON and the need to remove HTML tags for GPT to correctly identify links from the text.

Key takeaways:

  • The author used the GPT API to categorize and analyze book recommendations from Hacker News threads, extracting book titles, authors, and URLs.
  • The top three most recommended books were "Structure and Interpretation of Computer Programs", "Gödel, Escher, Bach", and "How to Win Friends and Influence People".
  • Some challenges encountered during the project included handling invalid JSON returns from the API, discarding responses with empty titles, and dealing with the non-deterministic nature of GPT's results.
  • The author has provided the raw data produced by GPT for further analysis, and also added Amazon affiliate links to the book URLs as a learning exercise.
View Full Article

Comments (0)

Be the first to comment!