Allow restricting google retrieval by domain (e.g. exclude social media)

Abierto
#76 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@leothomas ya está trabajando en esto.

Desde el 11/11/2026.

  • #79 de @leothomas — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
20/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
backend

Línea de trabajo

A pull request for this work is already open (#79), so the feature appears to be underway. To understand the proposed change, read core/contrust.py and locate SourceRetriever and its Serper query and hit-fetching flow. Done means optional domain filters affect the query and returned hits as described, with included_domains taking precedence and default behavior unchanged.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

The google (Serper) retriever searches the open web, so the best semantic match for an atom can be a source with no editorial or peer-review process. A Facebook group, Reddit thread or Quora answer discussing the topic then enters the Markov network as evidence. We ran into this evaluating science claims for NASA's AKD project.

ConTrust (core/contrust.py) helps by down-weighting low-credibility sources. But unrated domains such as facebook.com get the neutral 0.5 prior, and it can't express hard constraints like "only .gov/.edu sources".

Proposal

Add optional excluded_domains / included_domains to SourceRetriever (google only):

  • Apply them as -site: / site: operators on the Serper query, so filtered domains don't use up result slots.
  • Also filter the returned hits before any page is fetched. This covers cached results and engines that ignore the operator.
  • included_domains wins when both are set. Bare suffixes like gov / edu match any host ending in them.
  • Ship a SOCIAL_MEDIA_DOMAINS constant as a starting blocklist. The default stays None, so behaviour is unchanged unless you opt in.

PR to follow.

Lenguaje dominante
Python
Estrellas
45
Forks
14
Merge medio
5 h 1 min
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de IBM/FactReasoner

Todos los issues de IBM/FactReasoner

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.