使用ChatGPT从Hacker News提取码农必读书籍

2023-10-04 18:56:45 浏览数 (3)

Hacker News 推荐的书籍相对来讲,质量还是不错的,因此有人就想了一个办法,借助ChatGpt来分析推荐数据,整理出了排名前50的推荐书籍。分析这些数据,大概花了 40美刀。

下面这个是prompt

代码语言:javascript复制
prompt = [
            {"role": "system", "content": "Assistant that identifies book titles and authors in the following document and shows the words you match to a book title from. Some titles may be abbreviated, please expand the abbreviated title. If the document talks about an author but doesn't mention a book, leave "title" blank. If you know who the author is, provide the author. Don't include the book's subtitle. If the text is asking for a recommendation, without mentioning a book, then return an empty array. Provide your answer in a json array."}
            {"role": "user", "content": 'Wren's Explosion https://www.amazon.com/gp/395, and any Plath."'},
            {"role": "assistant", "content": '''[{"match":"'Wren's Explosion","title":"Explosion","author":"P.C. Wren","link":"https://www.amazon.com/gp/395"}, {"match":"any Plath","title":"", "author":"Sylvia Plath"}]'''},
            {"role":"user", "content":"3-days free trial isn't freemium."},
            {"role":"assistant", "content":"[]"},
            {"role":"user", "content": "Miranda Hamilton"},
            {"role":"assistant", "content": '''[{"match":"Miranda Hamilton","title":"Hamilton","author":"Lin-Manuel Miranda, Jeremy McCarter","link":""}]'''},
        ]

提取的书籍数据类似与这样的json结构

代码语言:javascript复制
[
  {
    "match": "Hitchhiker's Guide Vms Unsupported Undocumented Can Go Away At Any Time Feature",
    "title": "The Hitchhiker's Guide to the Galaxy",
    "author": "Douglas Adams",
    "link": "http://www.amazon.com/Hitchhikers-Guide-Vms-Unsupported-Undocumented-Can-Go-Away-At-Any-Time-Feature/dp/1878956000"
  }
]

以下是排名前 50 的书籍推荐:

#

书名

作者

推荐次数

1

Structure and Interpretation of Computer Programs

Abelson and Sussman

376

2

Gödel, Escher, Bach

Douglas Hofstadter

293

3

How to Win Friends and Influence People

Dale Carnegie

292

4

The C Programming Language

Brian Kernighan, Dennis Ritchie

284

5

Dune

Brian Herbert

263

6

Thinking, Fast and Slow

Daniel Kahneman

244

7

Meditations

Descartes

233

8

Atlas Shrugged

Ayn Rand

222

9

The Art of Computer Programming

Donald E. Knuth

213

10

Sapiens: A Brief History of Humankind

Yuval Harari

205

11

Zen and the Art of Motorcycle Maintenance

Robert M Pirsig

203

12

The Pragmatic Programmer

Andrew Hunt

203

13

Introduction to Algorithms

Charles E. Leiserson, Clifford Stein, Ronald Rivest, Thomas H. Cormen

171

14

The Selfish Gene

Richard Dawkins

168

15

Code: The Hidden Language of Computer Hardware and Software

Charles Petzold

160

16

The Mythical Man-Month

Fred Brooks

159

17

The Black Swan

Nassim Nicholas Taleb

158

18

Designing Data-Intensive Applications

Martin Kleppman

153

19

1984

George Orwell

152

20

Code Complete

Steve McConnell

149

21

Snow Crash

Neal Stephenson

146

22

The Three-Body Problem

Cixin Liu

143

23

Ender’s Game

Orson Scott Card

143

24

The Design of Everyday Things

Don Norman

136

25

Bible

Unknown

134

26

Founders at Work

Jessica Livingston

133

27

Antifragile

Nassim Nicholas Taleb

130

28

Man’s Search for Meaning

Victor E. Frankl

129

29

The Hitchhiker’s Guide to the Galaxy

Douglas Adams

128

30

Cryptonomicon

Neal Stephenson

127

31

The Fountainhead

Ayn Rand

127

32

Surely You’re Joking, Mr. Feynman!

Richard Feynman

125

33

Fooled by Randomness

Nassim Nicholas Taleb

125

34

Siddhartha

Herman Hesse

124

35

Foundation

Isaac Asimov

123

36

The Lord of the Rings

J. R. R. Tolkien

121

37

Zero to One

Peter Thiel

115

38

Calculus

Charles B. Morrey Jr., Murray H. Protter

114

39

Neuromancer

William Gibson

112

40

The Phoenix Project

Gene Kim

110

41

The Lean Startup

Eric Ries

110

42

Never Split the Difference

Chris Voss

108

43

Design Patterns

Addy Osmani

107

44

Guns, Germs, and Steel

Jared Diamond

107

45

JavaScript: The Good Parts

Douglas Crockford

106

46

Clean Code

Robert C. Martin

106

47

Deep Work

Cal Newport

105

48

The Elements of Computing Systems

Noam Nisan, Shimon Schocken

104

49

The Little Schemer

Daniel P. Friedman, Matthias Felleisen

102

50

Influence: The Psychology of Persuasion

Robert B. Cialdini

101

0 人点赞