Spaces:
Sleeping
Sleeping
Update routers/filter.py
Browse files- routers/filter.py +363 -22
routers/filter.py
CHANGED
@@ -262,13 +262,13 @@ async def filter_news(title: str, content: str, last_titles: list) -> dict:
|
|
262 |
- ideological_alignment ("left" | "center-left" | "center" | "center-right" | "right" | "apolitical"): The perceived political bias of the article.
|
263 |
- entity_type ("movie" | "series" | "event" | "person" | "place" | "other"): The type of main subject mentioned in the news.
|
264 |
- entity_name (string): The name of the person, title, event, or topic the article is primarily about.
|
265 |
-
- duplication (true | false): Whether the current news is a duplicate or highly similar to any of the previously published news titles.
|
266 |
"""
|
267 |
|
268 |
# Formata os últimos títulos para incluir no prompt - aumentado para 25 títulos
|
269 |
last_titles_formatted = "\n- ".join(last_titles[:25]) if last_titles else "No previous titles available"
|
270 |
|
271 |
-
# Primeiro exemplo -
|
272 |
EXAMPLE_INPUT_1 = f"""Title: 'The Gilded Age' Renewed for Season 4 at HBO — Everything We Know So Far
|
273 |
Content: The Gilded Age will return. HBO announced on Monday, July 28, that the series has been renewed for Season 4. This comes after the release of Season 3 Episode 6 on Sunday, July 27. There are two episodes left to go in the third season. The Season 3 finale will air on Sunday, August 10, on HBO. According to HBO, total premiere-night viewing for the third season has grown for five consecutive weeks, culminating in a 20 percent growth compared to last season. Fan engagement has also climbed, with social chatter rising nearly 60 percent week over week. The show has also received its most critical acclaim to date with Season 3, its highest-stakes season so far. In the July 27 episode, the series that's known for its low stakes but high-camp drama, a character was seemingly killed off in violent (for The Gilded Age) fashion. The show is already Emmy-winning. Production designer Bob Shaw took home an Emmy for
|
274 |
Last titles:
|
@@ -276,20 +276,56 @@ Last titles:
|
|
276 |
- Bilheteria: 'Quarteto Fantástico: Primeiros Passos' sobe para US$ 218 milhões globalmente, 'Superman' e 'F1' ultrapassam US$ 500 milhões
|
277 |
- Reboot de 'Quarteto Fantástico' da Marvel ultrapassa US$ 200 milhões globalmente"""
|
278 |
|
279 |
-
EXAMPLE_OUTPUT_1 = """{
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
Last titles:
|
285 |
- Sequência de "The Batman" ganha data de lançamento oficial da Warner Bros
|
286 |
- Sequência de "The Batman" de Robert Pattinson tem data oficial de lançamento para 2026
|
287 |
- Warner Bros. define data de lançamento da sequência de "The Batman" para 2026
|
288 |
- Sequência de 'O Casamento do Meu Melhor Amigo' terá roteiro da diretora de 'Vidas Passadas'"""
|
289 |
|
290 |
-
EXAMPLE_OUTPUT_2 = """{
|
291 |
-
|
292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
EXAMPLE_INPUT_3 = f"""Title: 9-1-1: Death of main character shakes series, which gets new date for the 9th season
|
294 |
Content: The 9-1-1 universe was permanently redefined after one of the most shocking events in its history. The show's eighth season bid farewell to one of its pillars with the death of Captain Bobby Nash, played by Peter Krause, in episode 15. Now, with the renewal for a ninth season confirmed, ABC has announced a schedule change: the premiere has been moved up to Thursday, October 9, 2025. Bobby Nash's death, the first of a main cast member, leaves a leadership vacuum in Battalion 118 and sets the main narrative arc for the new episodes. Peter Krause's departure had already been signaled, but the impact of his absence will be the driving force behind the next season, which will have 18 episodes. Showrunner Tim Minear had previously stated that, despite the death, the character would still appear in specific moments in the eighth season finale, fulfilling his promise.
|
295 |
Last titles:
|
@@ -297,9 +333,27 @@ Last titles:
|
|
297 |
- Datas de estreia da ABC no outono de 2025: '9-1-1', 'Nashville' e 'Grey's Anatomy' antecipadas
|
298 |
- Warner Bros. anuncia sequência de 'The Batman' para 2026"""
|
299 |
|
300 |
-
EXAMPLE_OUTPUT_3 = """{
|
301 |
-
|
302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
EXAMPLE_INPUT_4 = f"""Title: Julian McMahon, 'Fantastic Four,' 'Nip/Tuck' and 'FBI: Most Wanted' Star, Dies at 56
|
304 |
Content: Julian McMahon, the suave Australian actor best known for his performances on "FBI: Most Wanted," "Charmed," "Nip/Tuck" and the early aughts "Fantastic Four" films, died Wednesday in Florida. He was 56 and died after a battle with cancer. McMahon's death was confirmed through his reps, who shared a statement from his wife, Kelly McMahon, in remembrance of her husband. "With an open heart, I wish to share with the world that my beloved husband, Julian McMahon, died peacefully this week after a valiant effort to overcome cancer," she said. "Julian loved life. He loved his family. He loved his friends. He loved his work, and he loved his fans. His deepest wish was to bring joy into as many lives as possible. We ask for support during this time to allow our family to grieve in privacy. And we wish for all of those to whom Julian brought joy, to continue to find joy in life. We are grateful for the memories."
|
305 |
Last titles:
|
@@ -307,66 +361,353 @@ Last titles:
|
|
307 |
- Programas de TV Cancelados em 2025: Quais Séries Foram Canceladas
|
308 |
- Atores Australianos que Estão Fazendo Sucesso em Hollywood"""
|
309 |
|
310 |
-
EXAMPLE_OUTPUT_4 = """{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
|
312 |
# Estrutura de conversação correta com múltiplos exemplos
|
313 |
contents = [
|
314 |
-
# Primeiro exemplo
|
315 |
types.Content(
|
316 |
role="user",
|
317 |
parts=[
|
318 |
types.Part.from_text(text=EXAMPLE_INPUT_1)
|
319 |
]
|
320 |
),
|
321 |
-
# Primeiro exemplo: modelo responde com o formato correto
|
322 |
types.Content(
|
323 |
role="model",
|
324 |
parts=[
|
325 |
types.Part.from_text(text=EXAMPLE_OUTPUT_1)
|
326 |
]
|
327 |
),
|
328 |
-
# Segundo exemplo
|
329 |
types.Content(
|
330 |
role="user",
|
331 |
parts=[
|
332 |
types.Part.from_text(text=EXAMPLE_INPUT_2)
|
333 |
]
|
334 |
),
|
335 |
-
# Segundo exemplo: modelo responde marcando como não-notícia
|
336 |
types.Content(
|
337 |
role="model",
|
338 |
parts=[
|
339 |
types.Part.from_text(text=EXAMPLE_OUTPUT_2)
|
340 |
]
|
341 |
),
|
342 |
-
# Terceiro exemplo
|
343 |
types.Content(
|
344 |
role="user",
|
345 |
parts=[
|
346 |
types.Part.from_text(text=EXAMPLE_INPUT_3)
|
347 |
]
|
348 |
),
|
349 |
-
# Terceiro exemplo: modelo responde marcando como não-notícia
|
350 |
types.Content(
|
351 |
role="model",
|
352 |
parts=[
|
353 |
types.Part.from_text(text=EXAMPLE_OUTPUT_3)
|
354 |
]
|
355 |
),
|
356 |
-
# Quarto exemplo
|
357 |
types.Content(
|
358 |
role="user",
|
359 |
parts=[
|
360 |
types.Part.from_text(text=EXAMPLE_INPUT_4)
|
361 |
]
|
362 |
),
|
363 |
-
# Quarto exemplo: modelo responde marcando como notícia
|
364 |
types.Content(
|
365 |
role="model",
|
366 |
parts=[
|
367 |
types.Part.from_text(text=EXAMPLE_OUTPUT_4)
|
368 |
]
|
369 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
# Agora o usuário envia a notícia real para ser analisada
|
371 |
types.Content(
|
372 |
role="user",
|
|
|
262 |
- ideological_alignment ("left" | "center-left" | "center" | "center-right" | "right" | "apolitical"): The perceived political bias of the article.
|
263 |
- entity_type ("movie" | "series" | "event" | "person" | "place" | "other"): The type of main subject mentioned in the news.
|
264 |
- entity_name (string): The name of the person, title, event, or topic the article is primarily about.
|
265 |
+
- duplication (true | false): Whether the current news is a duplicate or highly similar to any of the previously published news titles (Last titles).
|
266 |
"""
|
267 |
|
268 |
# Formata os últimos títulos para incluir no prompt - aumentado para 25 títulos
|
269 |
last_titles_formatted = "\n- ".join(last_titles[:25]) if last_titles else "No previous titles available"
|
270 |
|
271 |
+
# Primeiro exemplo - SÉRIE HBO RENOVADA
|
272 |
EXAMPLE_INPUT_1 = f"""Title: 'The Gilded Age' Renewed for Season 4 at HBO — Everything We Know So Far
|
273 |
Content: The Gilded Age will return. HBO announced on Monday, July 28, that the series has been renewed for Season 4. This comes after the release of Season 3 Episode 6 on Sunday, July 27. There are two episodes left to go in the third season. The Season 3 finale will air on Sunday, August 10, on HBO. According to HBO, total premiere-night viewing for the third season has grown for five consecutive weeks, culminating in a 20 percent growth compared to last season. Fan engagement has also climbed, with social chatter rising nearly 60 percent week over week. The show has also received its most critical acclaim to date with Season 3, its highest-stakes season so far. In the July 27 episode, the series that's known for its low stakes but high-camp drama, a character was seemingly killed off in violent (for The Gilded Age) fashion. The show is already Emmy-winning. Production designer Bob Shaw took home an Emmy for
|
274 |
Last titles:
|
|
|
276 |
- Bilheteria: 'Quarteto Fantástico: Primeiros Passos' sobe para US$ 218 milhões globalmente, 'Superman' e 'F1' ultrapassam US$ 500 milhões
|
277 |
- Reboot de 'Quarteto Fantástico' da Marvel ultrapassa US$ 200 milhões globalmente"""
|
278 |
|
279 |
+
EXAMPLE_OUTPUT_1 = """{
|
280 |
+
"death_related":false,
|
281 |
+
"political_related":false,
|
282 |
+
"woke_related":false,
|
283 |
+
"spoilers":false,
|
284 |
+
"sensitive_theme":false,
|
285 |
+
"contains_video":false,
|
286 |
+
"is_news_content":true,
|
287 |
+
"relevance":"low",
|
288 |
+
"brazil_interest":true,
|
289 |
+
"breaking_news":true,
|
290 |
+
"audience_age_rating":14,
|
291 |
+
"regional_focus":"americas",
|
292 |
+
"country_focus":"us",
|
293 |
+
"ideological_alignment":"apolitical",
|
294 |
+
"entity_type":"series",
|
295 |
+
"entity_name":"The Gilded Age",
|
296 |
+
"duplication":false
|
297 |
+
}"""
|
298 |
+
|
299 |
+
# Segundo exemplo - SEQUÊNCIA DE FILME
|
300 |
+
EXAMPLE_INPUT_2 = f"""Title: 'My Best Friend's Wedding' Sequel in the Works: 'Materialists,' 'Past Lives' Director Celine Song to Write Screenplay
|
301 |
+
Content: A sequel to the Julia Roberts romantic comedy "My Best Friend's Wedding" is in early development at Sony Pictures. The studio has tapped "Materialists" and "Past Lives" writer-director Celine Song to pen a screenplay for the project, though she is not in talks to helm the feature.
|
302 |
Last titles:
|
303 |
- Sequência de "The Batman" ganha data de lançamento oficial da Warner Bros
|
304 |
- Sequência de "The Batman" de Robert Pattinson tem data oficial de lançamento para 2026
|
305 |
- Warner Bros. define data de lançamento da sequência de "The Batman" para 2026
|
306 |
- Sequência de 'O Casamento do Meu Melhor Amigo' terá roteiro da diretora de 'Vidas Passadas'"""
|
307 |
|
308 |
+
EXAMPLE_OUTPUT_2 = """{
|
309 |
+
"death_related":false,
|
310 |
+
"political_related":false,
|
311 |
+
"woke_related":false,
|
312 |
+
"spoilers":false,
|
313 |
+
"sensitive_theme":false,
|
314 |
+
"contains_video":false,
|
315 |
+
"is_news_content":true,
|
316 |
+
"relevance":"medium",
|
317 |
+
"brazil_interest":true,
|
318 |
+
"breaking_news":false,
|
319 |
+
"audience_age_rating":10,
|
320 |
+
"regional_focus":"americas",
|
321 |
+
"country_focus":"us",
|
322 |
+
"ideological_alignment":"apolitical",
|
323 |
+
"entity_type":"movie",
|
324 |
+
"entity_name":"My Best Friend's Wedding",
|
325 |
+
"duplication":true
|
326 |
+
}"""
|
327 |
+
|
328 |
+
# Terceiro exemplo - SÉRIE COM SPOILERS E MORTE DE PERSONAGEM
|
329 |
EXAMPLE_INPUT_3 = f"""Title: 9-1-1: Death of main character shakes series, which gets new date for the 9th season
|
330 |
Content: The 9-1-1 universe was permanently redefined after one of the most shocking events in its history. The show's eighth season bid farewell to one of its pillars with the death of Captain Bobby Nash, played by Peter Krause, in episode 15. Now, with the renewal for a ninth season confirmed, ABC has announced a schedule change: the premiere has been moved up to Thursday, October 9, 2025. Bobby Nash's death, the first of a main cast member, leaves a leadership vacuum in Battalion 118 and sets the main narrative arc for the new episodes. Peter Krause's departure had already been signaled, but the impact of his absence will be the driving force behind the next season, which will have 18 episodes. Showrunner Tim Minear had previously stated that, despite the death, the character would still appear in specific moments in the eighth season finale, fulfilling his promise.
|
331 |
Last titles:
|
|
|
333 |
- Datas de estreia da ABC no outono de 2025: '9-1-1', 'Nashville' e 'Grey's Anatomy' antecipadas
|
334 |
- Warner Bros. anuncia sequência de 'The Batman' para 2026"""
|
335 |
|
336 |
+
EXAMPLE_OUTPUT_3 = """{
|
337 |
+
"death_related":false,
|
338 |
+
"political_related":false,
|
339 |
+
"woke_related":false,
|
340 |
+
"spoilers":true,
|
341 |
+
"sensitive_theme":false,
|
342 |
+
"contains_video":false,
|
343 |
+
"is_news_content":true,
|
344 |
+
"relevance":"high",
|
345 |
+
"brazil_interest":true,
|
346 |
+
"breaking_news":true,
|
347 |
+
"audience_age_rating":14,
|
348 |
+
"regional_focus":"global",
|
349 |
+
"country_focus":null,
|
350 |
+
"ideological_alignment":"apolitical",
|
351 |
+
"entity_type":"series",
|
352 |
+
"entity_name":"9-1-1",
|
353 |
+
"duplication":true
|
354 |
+
}"""
|
355 |
+
|
356 |
+
# Quarto exemplo - MORTE DE CELEBRIDADE
|
357 |
EXAMPLE_INPUT_4 = f"""Title: Julian McMahon, 'Fantastic Four,' 'Nip/Tuck' and 'FBI: Most Wanted' Star, Dies at 56
|
358 |
Content: Julian McMahon, the suave Australian actor best known for his performances on "FBI: Most Wanted," "Charmed," "Nip/Tuck" and the early aughts "Fantastic Four" films, died Wednesday in Florida. He was 56 and died after a battle with cancer. McMahon's death was confirmed through his reps, who shared a statement from his wife, Kelly McMahon, in remembrance of her husband. "With an open heart, I wish to share with the world that my beloved husband, Julian McMahon, died peacefully this week after a valiant effort to overcome cancer," she said. "Julian loved life. He loved his family. He loved his friends. He loved his work, and he loved his fans. His deepest wish was to bring joy into as many lives as possible. We ask for support during this time to allow our family to grieve in privacy. And we wish for all of those to whom Julian brought joy, to continue to find joy in life. We are grateful for the memories."
|
359 |
Last titles:
|
|
|
361 |
- Programas de TV Cancelados em 2025: Quais Séries Foram Canceladas
|
362 |
- Atores Australianos que Estão Fazendo Sucesso em Hollywood"""
|
363 |
|
364 |
+
EXAMPLE_OUTPUT_4 = """{
|
365 |
+
"death_related":true,
|
366 |
+
"political_related":false,
|
367 |
+
"woke_related":false,
|
368 |
+
"spoilers":false,
|
369 |
+
"sensitive_theme":true,
|
370 |
+
"contains_video":false,
|
371 |
+
"is_news_content":true,
|
372 |
+
"relevance":"high",
|
373 |
+
"brazil_interest":true,
|
374 |
+
"breaking_news":true,
|
375 |
+
"audience_age_rating":14,
|
376 |
+
"regional_focus":"americas",
|
377 |
+
"country_focus":"au",
|
378 |
+
"ideological_alignment":"apolitical",
|
379 |
+
"entity_type":"person",
|
380 |
+
"entity_name":"Julian McMahon",
|
381 |
+
"duplication":false
|
382 |
+
}"""
|
383 |
+
|
384 |
+
# Quinto exemplo - SEQUÊNCIA DE FILME COM ELEMENTOS POLÍTICOS
|
385 |
+
EXAMPLE_INPUT_5 = f"""Title: Mikey Madison and Jeremy Allen White Circling Lead Roles in Aaron Sorkin's 'Social Network' Sequel
|
386 |
+
Content: Mikey Madison and Jeremy Allen White are circling the lead roles for Aaron Sorkin's sequel to the 2010 Oscar winner "The Social Network," according to sources with knowledge of the project. While no offers have been made, Sorkin has met with both Madison and White about the project. The film is still very much in the development stage and has yet to receive the green light from Sony.
|
387 |
+
Last titles:
|
388 |
+
- Wild Bill Wichrowski do 'Deadliest Catch' ficará de fora da 21ª temporada após batalha contra o câncer de próstata
|
389 |
+
- Loni Anderson, estrela de 'WKRP in Cincinnati', morre aos 79 anos
|
390 |
+
- O filme "esquecido" do universo "Invocação do Mal": entenda por que "A Maldição da Chorona" é considerado o pior da franquia
|
391 |
+
- Rose Byrne em colapso: novo filme da A24 é descrito como 'teste de resistência'
|
392 |
+
- Jornada nas Estrelas: como entender a linha do tempo de uma das maiores sagas da ficção
|
393 |
+
- Crise na Mubi: cineastas de peso, incluindo israelenses, exigem boicote por laços com investidor militar"""
|
394 |
+
|
395 |
+
EXAMPLE_OUTPUT_5 = """{
|
396 |
+
"death_related":false,
|
397 |
+
"political_related":true,
|
398 |
+
"woke_related":false,
|
399 |
+
"spoilers":false,
|
400 |
+
"sensitive_theme":false,
|
401 |
+
"contains_video":false,
|
402 |
+
"is_news_content":true,
|
403 |
+
"relevance":"high",
|
404 |
+
"brazil_interest":true,
|
405 |
+
"breaking_news":true,
|
406 |
+
"audience_age_rating":14,
|
407 |
+
"regional_focus":"americas",
|
408 |
+
"country_focus":"au",
|
409 |
+
"ideological_alignment":"apolitical",
|
410 |
+
"entity_type":"movie",
|
411 |
+
"entity_name":"The Social Network",
|
412 |
+
"duplication":false
|
413 |
+
}"""
|
414 |
+
|
415 |
+
# Sexto exemplo - EPISÓDIO COM SPOILERS
|
416 |
+
EXAMPLE_INPUT_6 = f"""Title: Star Trek: Strange New Worlds' Holodeck Episode Began As A Tribute To A DS9 Masterpiece [Exclusive]
|
417 |
+
Content: Spoilers for episode 4 of "Star Trek: Strange New Worlds" season 4, titled "A Space Adventure Hour," episode follow. The newest episode of "Star Trek: Strange New Worlds" — "A Space Adventure Hour," written by Dana Horgan & Kathryn Lyn — features the show going back to the past. Except, it's not a time travel episode. To test a prototype holodeck, La'an (Christina Chong) crafts a murder mystery story set in mid-20th century Hollywood where she's the detective, Amelia Moon. And the suspects are the cast and crew of a space adventure series, "The Last Frontier," that's about to be canceled. The episode has enough metatext to fill the whole Enterprise, because "The Last Frontier" is a clear stand-in for "Star Trek: The Original Series." However, the writers weren't just thinking about "TOS" when it came to "A Space Adventure Hour."
|
418 |
+
Last titles:
|
419 |
+
- Wild Bill Wichrowski do 'Deadliest Catch' ficará de fora da 21ª temporada após batalha contra o câncer de próstata
|
420 |
+
- Loni Anderson, estrela de 'WKRP in Cincinnati', morre aos 79 anos
|
421 |
+
- O filme "esquecido" do universo "Invocação do Mal": entenda por que "A Maldição da Chorona" é considerado o pior da franquia
|
422 |
+
- Rose Byrne em colapso: novo filme da A24 é descrito como 'teste de resistência'
|
423 |
+
- Jornada nas Estrelas: como entender a linha do tempo de uma das maiores sagas da ficção
|
424 |
+
- Crise na Mubi: cineastas de peso, incluindo israelenses, exigem boicote por laços com investidor militar"""
|
425 |
+
|
426 |
+
EXAMPLE_OUTPUT_6 = """{
|
427 |
+
"death_related": false,
|
428 |
+
"political_related": false,
|
429 |
+
"woke_related": false,
|
430 |
+
"spoilers": true,
|
431 |
+
"sensitive_theme": false,
|
432 |
+
"contains_video": false,
|
433 |
+
"is_news_content": true,
|
434 |
+
"relevance": "medium",
|
435 |
+
"brazil_interest": true,
|
436 |
+
"breaking_news": false,
|
437 |
+
"audience_age_rating": 10,
|
438 |
+
"regional_focus": "global",
|
439 |
+
"country_focus": "us",
|
440 |
+
"ideological_alignment": "apolitical",
|
441 |
+
"entity_type": "series",
|
442 |
+
"entity_name": "Star Trek: Strange New Worlds",
|
443 |
+
"duplication": false
|
444 |
+
}"""
|
445 |
+
|
446 |
+
# Sétimo exemplo - SÉRIE DE HORROR (TEMA SENSÍVEL)
|
447 |
+
EXAMPLE_INPUT_7 = f"""Title: 'Hostel' TV Series From Eli Roth and Starring Paul Giamatti Lands at Peacock for Development (Exclusive)
|
448 |
+
Content: The "Hostel" TV series has found a home at Peacock. Variety has learned exclusively that the TV extension of the horror film franchise is currently in development at the NBCUniversal streamer. The show was previously reported to be in the works in June 2024, but no platform was attached at that time. As originally reported, Paul Giamatti is attached to star in the series, with "Hostel" mastermind Eli Roth set to write, direct, and executive produce. Chris Briggs and Mike Fleiss, who have produced all the "Hostel" films, are also executive producers. Fifth Season is the studio. Exact plot details are being kept under wraps.
|
449 |
+
Last titles:
|
450 |
+
- Wild Bill Wichrowski do 'Deadliest Catch' ficará de fora da 21ª temporada após batalha contra o câncer de próstata
|
451 |
+
- Loni Anderson, estrela de 'WKRP in Cincinnati', morre aos 79 anos
|
452 |
+
- O filme "esquecido" do universo "Invocação do Mal": entenda por que "A Maldição da Chorona" é considerado o pior da franquia
|
453 |
+
- Rose Byrne em colapso: novo filme da A24 é descrito como 'teste de resistência'
|
454 |
+
- Jornada nas Estrelas: como entender a linha do tempo de uma das maiores sagas da ficção
|
455 |
+
- Crise na Mubi: cineastas de peso, incluindo israelenses, exigem boicote por laços com investidor militar"""
|
456 |
+
|
457 |
+
EXAMPLE_OUTPUT_7 = """{
|
458 |
+
"death_related": false,
|
459 |
+
"political_related": false,
|
460 |
+
"woke_related": false,
|
461 |
+
"spoilers": false,
|
462 |
+
"sensitive_theme": true,
|
463 |
+
"contains_video": false,
|
464 |
+
"is_news_content": true,
|
465 |
+
"relevance": "medium",
|
466 |
+
"brazil_interest": false,
|
467 |
+
"breaking_news": false,
|
468 |
+
"audience_age_rating": 18,
|
469 |
+
"regional_focus": "global",
|
470 |
+
"country_focus": "us",
|
471 |
+
"ideological_alignment": "apolitical",
|
472 |
+
"entity_type": "series",
|
473 |
+
"entity_name": "Hostel",
|
474 |
+
"duplication": false
|
475 |
+
}"""
|
476 |
+
|
477 |
+
# Oitavo exemplo - EVENTO ESPORTIVO
|
478 |
+
EXAMPLE_INPUT_8 = f"""Title: Is Canelo vs. Crawford Free on Netflix? Here's How to Watch the Fight
|
479 |
+
Content: When boxing legends Saúl "Canelo" Álvarez and Terence "Bud" Crawford meet in the ring on Sept. 13, it won't just be a clash of champions — it could be a career-defining moment. For the first time ever two of the most dominant fighters of their generation will share the ring. Only one will walk away as the greatest of their era. Given the high stakes and the long tradition of pay-per-view boxing events, fans are asking: Is Canelo vs. Crawford free on Netflix? Keep scrolling to learn more.
|
480 |
+
Last titles:
|
481 |
+
- Wild Bill Wichrowski do 'Deadliest Catch' ficará de fora da 21ª temporada após batalha contra o câncer de próstata
|
482 |
+
- Loni Anderson, estrela de 'WKRP in Cincinnati', morre aos 79 anos
|
483 |
+
- O filme "esquecido" do universo "Invocação do Mal": entenda por que "A Maldição da Chorona" é considerado o pior da franquia
|
484 |
+
- Rose Byrne em colapso: novo filme da A24 é descrito como 'teste de resistência'
|
485 |
+
- Jornada nas Estrelas: como entender a linha do tempo de uma das maiores sagas da ficção
|
486 |
+
- Crise na Mubi: cineastas de peso, incluindo israelenses, exigem boicote por laços com investidor militar"""
|
487 |
+
|
488 |
+
EXAMPLE_OUTPUT_8 = """{
|
489 |
+
"death_related": false,
|
490 |
+
"political_related": false,
|
491 |
+
"woke_related": false,
|
492 |
+
"spoilers": false,
|
493 |
+
"sensitive_theme": false,
|
494 |
+
"contains_video": false,
|
495 |
+
"is_news_content": true,
|
496 |
+
"relevance": "high",
|
497 |
+
"brazil_interest": true,
|
498 |
+
"breaking_news": false,
|
499 |
+
"audience_age_rating": 10,
|
500 |
+
"regional_focus": "global",
|
501 |
+
"country_focus": "us",
|
502 |
+
"ideological_alignment": "apolitical",
|
503 |
+
"entity_type": "event",
|
504 |
+
"entity_name": "Canelo Álvarez vs. Terence Crawford",
|
505 |
+
"duplication": false
|
506 |
+
}"""
|
507 |
+
|
508 |
+
# Nono exemplo - MORTE DE CELEBRIDADE (DUPLICAÇÃO)
|
509 |
+
EXAMPLE_INPUT_9 = f"""Title: Loni Anderson, Emmy- and Golden Globe-Nominated Star of 'Wkrp in Cincinnati,' Dies at 79
|
510 |
+
Content: Loni Anderson, whose beloved role as Jennifer Marlowe on "WKRP in Cincinnati" was nominated for Emmy and Golden Globe awards, has died, her publicist confirmed Sunday. She was 79.
|
511 |
+
Last titles:
|
512 |
+
- Wild Bill Wichrowski do 'Deadliest Catch' ficará de fora da 21ª temporada após batalha contra o câncer de próstata
|
513 |
+
- Loni Anderson, estrela de 'WKRP in Cincinnati', morre aos 79 anos
|
514 |
+
- O filme "esquecido" do universo "Invocação do Mal": entenda por que "A Maldição da Chorona" é considerado o pior da franquia
|
515 |
+
- Rose Byrne em colapso: novo filme da A24 é descrito como 'teste de resistência'
|
516 |
+
- Jornada nas Estrelas: como entender a linha do tempo de uma das maiores sagas da ficção
|
517 |
+
- Crise na Mubi: cineastas de peso, incluindo israelenses, exigem boicote por laços com investidor militar
|
518 |
+
- Liam Neeson e Joe Keery enfrentam terror biológico no trailer de Cold Storage
|
519 |
+
- TIFF 2025: de John Candy a Lucrecia Martel, conheça os documentários do ano"""
|
520 |
+
|
521 |
+
EXAMPLE_OUTPUT_9 = """{
|
522 |
+
"death_related": true,
|
523 |
+
"political_related": false,
|
524 |
+
"woke_related": false,
|
525 |
+
"spoilers": false,
|
526 |
+
"sensitive_theme": false,
|
527 |
+
"contains_video": false,
|
528 |
+
"is_news_content": true,
|
529 |
+
"relevance": "medium",
|
530 |
+
"brazil_interest": false,
|
531 |
+
"breaking_news": true,
|
532 |
+
"audience_age_rating": 10,
|
533 |
+
"regional_focus": "global",
|
534 |
+
"country_focus": "us",
|
535 |
+
"ideological_alignment": "apolitical",
|
536 |
+
"entity_type": "person",
|
537 |
+
"entity_name": "Loni Anderson",
|
538 |
+
"duplication": true
|
539 |
+
}"""
|
540 |
+
|
541 |
+
# Décimo exemplo - FILME DE FESTIVAL (BAIXA RELEVÂNCIA)
|
542 |
+
EXAMPLE_INPUT_10 = f"""Title: Jim Jarmusch's 'Father Mother Sister Brother' Sells to Multiple Territories Ahead of Venice Premiere
|
543 |
+
Content: Jim Jarmusch's "Father Mother Sister Brother" has sold to multiple territories ahead of its world premiere in competition at the Venice Film Festival. The film stars Tom Waits, Adam Driver, Mayim Bialik, Charlotte Rampling, Cate Blanchett, Vicky Krieps, Sarah Greene, Indya Moore, Luka Sabbat and Françoise Lebrun. Distribution rights have been picked up in Italy (Lucky Red), Spain (Avalon Distribucion Audiovisual), Portugal (Nos Lusomundo), Greece (Cinobo), Poland (Gutek Film), Hungary (Cirko Films), Romania (Bad Unicorn), Former Yugoslavia (MCF MegaCom Film), Czech Republic and Slovakia (Aerofilms), Middle East and North Africa (Front Row Filmed Ent.), South Korea (Andamiro Films), and Hong Kong (Edko Films).
|
544 |
+
Last titles:
|
545 |
+
- Wild Bill Wichrowski do 'Deadliest Catch' ficará de fora da 21ª temporada após batalha contra o câncer de próstata
|
546 |
+
- Loni Anderson, estrela de 'WKRP in Cincinnati', morre aos 79 anos
|
547 |
+
- O filme "esquecido" do universo "Invocação do Mal": entenda por que "A Maldição da Chorona" é considerado o pior da franquia
|
548 |
+
- Rose Byrne em colapso: novo filme da A24 é descrito como 'teste de resistência'
|
549 |
+
- Jornada nas Estrelas: como entender a linha do tempo de uma das maiores sagas da ficção
|
550 |
+
- Crise na Mubi: cineastas de peso, incluindo israelenses, exigem boicote por laços com investidor militar
|
551 |
+
- Universo 'Stranger Things' se expande: série animada e peça de teatro são confirmadas
|
552 |
+
- Wandinha: O que já sabemos sobre a 2ª temporada e os boatos que circulam na internet
|
553 |
+
- Novo filme de Park Chan-wook, 'No Other Choice', escala festivais e une estrelas
|
554 |
+
- Homem-Aranha 4: Tom Holland revela novo traje e produção de 'Um Novo Dia' começa com participações surpreendentes
|
555 |
+
- Quarteto Fantástico segue no topo das bilheterias, mas queda preocupa
|
556 |
+
- Novo filme de Jim Jarmusch com Adam Driver e Cate Blanchett será distribuído pela MUBI
|
557 |
+
- Tulsa King: 3ª temporada com Sylvester Stallone ganha data de estreia e primeiras imagens"""
|
558 |
+
|
559 |
+
EXAMPLE_OUTPUT_10 = """{
|
560 |
+
"death_related": false,
|
561 |
+
"political_related": false,
|
562 |
+
"woke_related": false,
|
563 |
+
"spoilers": false,
|
564 |
+
"sensitive_theme": false,
|
565 |
+
"contains_video": false,
|
566 |
+
"is_news_content": true,
|
567 |
+
"relevance": "low",
|
568 |
+
"brazil_interest": false,
|
569 |
+
"breaking_news": false,
|
570 |
+
"audience_age_rating": 10,
|
571 |
+
"regional_focus": "global",
|
572 |
+
"country_focus": "us",
|
573 |
+
"ideological_alignment": "apolitical",
|
574 |
+
"entity_type": "movie",
|
575 |
+
"entity_name": "Father Mother Sister Brother",
|
576 |
+
"duplication": true
|
577 |
+
}"""
|
578 |
|
579 |
# Estrutura de conversação correta com múltiplos exemplos
|
580 |
contents = [
|
581 |
+
# Primeiro exemplo
|
582 |
types.Content(
|
583 |
role="user",
|
584 |
parts=[
|
585 |
types.Part.from_text(text=EXAMPLE_INPUT_1)
|
586 |
]
|
587 |
),
|
|
|
588 |
types.Content(
|
589 |
role="model",
|
590 |
parts=[
|
591 |
types.Part.from_text(text=EXAMPLE_OUTPUT_1)
|
592 |
]
|
593 |
),
|
594 |
+
# Segundo exemplo
|
595 |
types.Content(
|
596 |
role="user",
|
597 |
parts=[
|
598 |
types.Part.from_text(text=EXAMPLE_INPUT_2)
|
599 |
]
|
600 |
),
|
|
|
601 |
types.Content(
|
602 |
role="model",
|
603 |
parts=[
|
604 |
types.Part.from_text(text=EXAMPLE_OUTPUT_2)
|
605 |
]
|
606 |
),
|
607 |
+
# Terceiro exemplo
|
608 |
types.Content(
|
609 |
role="user",
|
610 |
parts=[
|
611 |
types.Part.from_text(text=EXAMPLE_INPUT_3)
|
612 |
]
|
613 |
),
|
|
|
614 |
types.Content(
|
615 |
role="model",
|
616 |
parts=[
|
617 |
types.Part.from_text(text=EXAMPLE_OUTPUT_3)
|
618 |
]
|
619 |
),
|
620 |
+
# Quarto exemplo
|
621 |
types.Content(
|
622 |
role="user",
|
623 |
parts=[
|
624 |
types.Part.from_text(text=EXAMPLE_INPUT_4)
|
625 |
]
|
626 |
),
|
|
|
627 |
types.Content(
|
628 |
role="model",
|
629 |
parts=[
|
630 |
types.Part.from_text(text=EXAMPLE_OUTPUT_4)
|
631 |
]
|
632 |
),
|
633 |
+
# Quinto exemplo
|
634 |
+
types.Content(
|
635 |
+
role="user",
|
636 |
+
parts=[
|
637 |
+
types.Part.from_text(text=EXAMPLE_INPUT_5)
|
638 |
+
]
|
639 |
+
),
|
640 |
+
types.Content(
|
641 |
+
role="model",
|
642 |
+
parts=[
|
643 |
+
types.Part.from_text(text=EXAMPLE_OUTPUT_5)
|
644 |
+
]
|
645 |
+
),
|
646 |
+
# Sexto exemplo
|
647 |
+
types.Content(
|
648 |
+
role="user",
|
649 |
+
parts=[
|
650 |
+
types.Part.from_text(text=EXAMPLE_INPUT_6)
|
651 |
+
]
|
652 |
+
),
|
653 |
+
types.Content(
|
654 |
+
role="model",
|
655 |
+
parts=[
|
656 |
+
types.Part.from_text(text=EXAMPLE_OUTPUT_6)
|
657 |
+
]
|
658 |
+
),
|
659 |
+
# Sétimo exemplo
|
660 |
+
types.Content(
|
661 |
+
role="user",
|
662 |
+
parts=[
|
663 |
+
types.Part.from_text(text=EXAMPLE_INPUT_7)
|
664 |
+
]
|
665 |
+
),
|
666 |
+
types.Content(
|
667 |
+
role="model",
|
668 |
+
parts=[
|
669 |
+
types.Part.from_text(text=EXAMPLE_OUTPUT_7)
|
670 |
+
]
|
671 |
+
),
|
672 |
+
# Oitavo exemplo
|
673 |
+
types.Content(
|
674 |
+
role="user",
|
675 |
+
parts=[
|
676 |
+
types.Part.from_text(text=EXAMPLE_INPUT_8)
|
677 |
+
]
|
678 |
+
),
|
679 |
+
types.Content(
|
680 |
+
role="model",
|
681 |
+
parts=[
|
682 |
+
types.Part.from_text(text=EXAMPLE_OUTPUT_8)
|
683 |
+
]
|
684 |
+
),
|
685 |
+
# Nono exemplo
|
686 |
+
types.Content(
|
687 |
+
role="user",
|
688 |
+
parts=[
|
689 |
+
types.Part.from_text(text=EXAMPLE_INPUT_9)
|
690 |
+
]
|
691 |
+
),
|
692 |
+
types.Content(
|
693 |
+
role="model",
|
694 |
+
parts=[
|
695 |
+
types.Part.from_text(text=EXAMPLE_OUTPUT_9)
|
696 |
+
]
|
697 |
+
),
|
698 |
+
# Décimo exemplo
|
699 |
+
types.Content(
|
700 |
+
role="user",
|
701 |
+
parts=[
|
702 |
+
types.Part.from_text(text=EXAMPLE_INPUT_10)
|
703 |
+
]
|
704 |
+
),
|
705 |
+
types.Content(
|
706 |
+
role="model",
|
707 |
+
parts=[
|
708 |
+
types.Part.from_text(text=EXAMPLE_OUTPUT_10)
|
709 |
+
]
|
710 |
+
),
|
711 |
# Agora o usuário envia a notícia real para ser analisada
|
712 |
types.Content(
|
713 |
role="user",
|