15 minute read

Beberapa hari ini, saya masih penasaran mengoprek beberapa model LLM yang tersedia di situs Huggingface. Salah satu topik LLM yang menarik menurut saya adalah text summarization.

Tiga tahun lalu, saya sempat membuat sendiri algoritma text summarization dengan menggunakan prinsip importance score per word yang saya kawinkan dengan network analysis. Hasilnya sendiri memuaskan bagi saya. Silakan rekan-rekan semua cek kembali tulisannya di sini.

Kali ini, saya akan mencoba menggunakan salah satu model LLM summarization yang ada di situs Huggingface. Saya mencoba model BART buatan tim Facebook.


Mencoba dengan Artikel Wumard

Agar bisa head to head dengan algoritma buatan saya, saya akan gunakan artikel yang sama dengan tulisan saya sebelumnya, yakni artikel tulisan Pak Wumard di blog pribadinya.

Setelah saya coba, ternyata hasilnya mengecewakan! Model ini tidak bisa melakukan tugasnya dengan baik dan benar.

Jangan-jangan karena model ini dibangun bukan berasal dari Bahasa Indonesia?

Begitu pikir saya. Akibatnya, saya coba ganti modelnya dengan bert2bert yang dibangun dari bahasa Indonesia. Hasilnya bagaimana? Tetap kureng menurut saya. Rekan-rekan bisa mencobanya sendiri ya menggunakan layanan di situs Huggingface.

Oleh karena itu, saya akan coba gunakan data teks Bahasa Inggris untuk di-summarize-kan. Saya akan coba bandingkan hasil model Facebook dengan model saya.


Data Teks Asli

Berikut adalah data teks asli yang akan saya summarization:

After helping Bruce Wayne / Batman and Diana Prince / Wonder Woman stop a robbery in Gotham City, Barry Allen revisits his childhood home, where he lived with his parents Nora and Henry, before Henry’s wrongful imprisonment for Nora’s murder. On the day of her death, Nora sent Henry to the grocery store for a can of tomatoes that she forgot to buy, leaving her alone in the kitchen, resulting in her being killed by an unidentified assailant. Overcome by emotions, Barry accidentally uses the Speed Force to form a Chronobowl and travel back in time earlier in the day. Despite Bruce’s warnings of time travel’s unintended consequences, Barry time travels and places the can of tomatoes in Nora’s cart at the store, so that his father will not have to leave the house. As he returns to the present, Barry is knocked out of the Chronobowl by an unknown speedster and ends up in a 2013 where Nora is alive. He encounters his parents, his past self, and realizes this is the day he originally obtained his powers.

In order to make sure his past self gains superpowers, the two Barrys go to the Central City Police Department, where Barry re-enacts the event for 2013-Barry to be struck by lightning. Both end up getting struck by the lightning, giving 2013-Barry powers, but causing Barry to lose his own. As Barry struggles to train 2013-Barry on properly using his powers, they learn that General Zod is preparing to invade Earth.[c] In an effort to fight Zod, the Barrys attempt to assemble the Justice League but are unsuccessful; in their timeline, they cannot locate Diana, Victor Stone has not gained his abilities yet, and Arthur Curry was never born. They travel to Wayne Manor, hoping to find Bruce, but instead find an alternate variant who has long retired. Bruce theorizes that using time travel to alter history affects events both prior to and after the alteration. They convince Bruce to return as Batman and help them find Kal-El / Superman.

The Barrys and Batman locate a Kryptonian pod discovered in Siberia. Upon arrival, they instead find Kal-El’s cousin, Kara Zor-El, imprisoned in the facility. They rescue Kara and return to Wayne mansion. Barry enlists Bruce’s help to regain his power once more. The first two attempts fail, prompting Kara to fly Barry into a storm, where he regains his powers. Kara and Batman join the Barrys to fight Zod and his forces. During the battle, Kara learns that Zod had intercepted Kal-El’s escape pod and killed him in the process of extracting the Codex needed to repopulate the Kryptonian species. The Codex is actually within Kara. Zod subdues and kills her, then extracts the Codex from her blood; meanwhile, Batman sacrifices himself in an unsuccessful attempt to destroy Zod’s ship.

The Barrys repeatedly time travel to save Batman and Kara but keep failing. Barry realizes that this sequence of events cannot be changed, but 2013-Barry keeps trying. As 2013-Barry travels, the multiverse starts to implode. The unknown speedster who initially knocked Barry out of the Speed Force returns and is revealed to be an older, future version of 2013-Barry who still believes he can defeat Zod and save his Earth. He becomes angry when Barry reveals his intention to reverse the changes he made to the timeline by letting Nora die. The elder 2013-Barry attempts to kill Barry, but instead impales young 2013-Barry, who sacrifices himself to save Barry and wipe his future self from the timeline.

Barry reverts the timeline and comes to terms with his mother’s death; however, he subtly alters the past by moving the tomato cans to a higher shelf. Returning to the present day, Barry attends Henry’s court hearing, where the security footage now reveals Henry looking up to grab the tomato can, allowing for his exoneration. After returning to the present, Barry is contacted by Bruce, whose appearance has changed once again as a result of the timeline alteration.

Iya, betul saya menggunakan alur cerita dari film The Flash. Kita akan cek, summary mana yang lebih masuk akal.

Hasil Algoritma Sendiri

Berikut adalah hasil summarization menggunakan model yang pernah saya buat:

in order to make sure his past self gains superpowers, the two barrys go to the central city police department, where barry re-enacts the event for 2013-barry to be struck by lightning. both end up getting struck by the lightning, giving 2013-barry powers, but causing barry to lose his own. barry enlists bruce’s help to regain his power once more. the unknown speedster who initially knocked barry out of the speed force returns and is revealed to be an older, future version of 2013-barry who still believes he can defeat zod and save his earth. he becomes angry when barry reveals his intention to reverse the changes he made to the timeline by letting nora die. after returning to the present, barry is contacted by bruce, whose appearance has changed once again as a result of the timeline alteration.

Hasil LLM BART dari Facebook

Berikut adalah hasil summarization menggunakan LLM milik Facebook:

After helping Bruce Wayne / Batman and Diana Prince / Wonder Woman stop a robbery in Gotham City, Barry Allen revisits his childhood home, where he lived with his parents Nora and Henry. On the day of her death, Nora sent Henry to the grocery store for a can of tomatoes that she forgot to buy, leaving her alone in the kitchen, resulting in her being killed by an unidentified assailant. Overcome by emotions, Barry accidentally uses the Speed Force to form a Chronobowl and travel back in time earlier in the day. He encounters his parents, his past self, and realizes this is the day he originally obtained his powers. As Barry struggles to train 2013-Barry on properly using his powers, they learn that General Zod is preparing to invade Earth.


Kesimpulan

Hasilnya menarik yah

Model milik Facebook berhasil membuat sinopsis cerita di separuh awal film. Sedangkan model yang saya buat berhasil menuliskan jalan cerita paruh kedua hingga ending film.

Bagaimana menurut kalian?


if you find this article helpful, support this blog by clicking the ads.