genai_fiction_summary
1.0.0
釋放生成式人工智慧的力量,進行全面的文檔分析和總結。有關更多信息,請參閱部落格文章:掌握長文檔洞察:使用 Amazon Bedrock 和 Anthropic Claude 2 Foundation Model 進行高級總結。
以下 Jupyter Notebook 包含部落格文章和影片中包含的所有範例:long_text_summarization_v1.ipynb。該筆記本的較新版本 long_text_summarization_v2.ipynb 也可用。
腳本是在筆記本之前編寫的。筆記型電腦更新了。
python3 -m pip install virtualenv
virtualenv summarize
python3 -m venv summarize
source summarize/bin/activate
python3 -m pip install -r requirements.txt -Uq
cd older_scripts/
python ./book_summary_05_character.py
2023-10-28 08:29:15,761 - utilities - INFO - Response body: {'completion': ' Here is a single-paragraph description of Count Dracula:nnCount Dracula is an ancient vampire of nobility from the remote mountains of Transylvania who resides alone in a decaying yet magnificent castle. He initially appears charming and welcoming but gradually reveals his true sinister and threatening nature. With his gaunt figure, waxen skin, high aquiline nose, pointed ears, sharp teeth and burning red eyes, Dracula exhibits a mysterious magnetism and power over humans, able to control animals and the weather. He attacks the innocent Jonathan Harker, later turning Lucy Westenra into a vampire. Persistent in his vampiric evil, Dracula possesses supernatural abilities and cunning intelligence, escaping capture multiple times. Though eloquent and refined on the surface, at his core Dracula is a ruthless predator who spreads his undead curse, requiring the combined efforts of Dr. Van Helsing and his allies to finally defeat him.', 'stop_reason': 'stop_sequence'}
2023-10-28 14:57:05,196 - utilities - INFO - Response body: {'completion': ' Here are 3 examples of character types from the chapter:nnProtagonist - Jonathan Harker: The main protagonist. Struggles against Dracula and tries to protect his wife Mina.nnAntagonist - Count Dracula: The main antagonist. A vampire who attacks Mina and opposes the protagonists. nnConfidant - Dr. Van Helsing: Acts as a mentor and confidant to the protagonists, guiding them in their fight against Dracula with his knowledge.', 'stop_reason': 'stop_sequence'}
2023-10-28 13:01:27,380 - utilities - INFO - Response body: {'completion': ' Here are 2-3 examples of literary devices found in the chapter:nn[Foreshadowing]: The howling of the dogs and wolves foreshadows impending danger and builds suspense. The driver's comment "For the dead travel fast" also foreshadows supernatural events to come.nn[Imagery]: Vivid imagery is used throughout to describe the scenery, people, and events, such as "the green grass under the trees spangled with the fallen petals". This helps create a rich, immersive setting.nn[Personification]: The mountains and cliffs are described as frowning down on the travelers, giving human traits to the landscape. This helps create an ominous, threatening mood.', 'stop_reason': 'stop_sequence'}