[BUG]: Article cleaner removes boilerplate phrases from inside article sentences

オープン
#181 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

@itsnjstyle27 がすでに取り組んでいます。

2026年10月30日 から。

  • #182 @itsnjstyle27 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

Start in backend/app/modules/scraper/cleaner.py at clean_extracted_text; run the reproduction snippet to see the sentence truncation and the about us word cut. Compare how phrases ending in .* and short phrases like about us are matched, then restrict removal to whole boilerplate lines. Add tests covering lines that should be removed and article sentences that must survive; done when the snippet returns both sentences intact.

索引モデルが issue の本文から書いたものです。

説明

Description

clean_extracted_text in backend/app/modules/scraper/cleaner.py removes its boilerplate phrases wherever they appear in the article, not only on boilerplate lines. So it also changes the article text itself:

  • Phrases that end in .* remove the rest of the sentence. An article line like "An engine powered by hydrogen could drive a car for five hundred kilometres." becomes "An engine", because of powered by .*. The same happens with photo by.*, read more at.*, disclaimer:.* and the others.
  • Short phrases are cut out of words. about us turns "Readers asked about using the new tool" into "Readers asked ing the new tool".

The cleaned text is what the bias check, fact check and perspective steps get, so they work on a damaged article.

Steps to reproduce

from app.modules.scraper.cleaner import clean_extracted_text

print(clean_extracted_text(
    "An engine powered by hydrogen could drive a car for five hundred kilometres.\n"
    "Readers asked about using the new tool in newsrooms around the world."
))

The first sentence is reduced to "An engine" (and then dropped as too short), and the second loses "about us".

Expected

Only lines that are boilerplate (for example a line starting with "Read more at" or "Sign up for our newsletter") are removed, and article sentences stay as they are.

I have a fix with tests ready and will open a PR.

主要言語
TypeScript
スター
58
フォーク
90
平均マージ
11時間 51分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AOSSIE-Org/Perspective のほかの issue

AOSSIE-Org/Perspective の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。