Skip to content

Fix/improve default search json#51

Merged
cgoudet merged 4 commits intomainfrom
fix/improve_default_search_json
Apr 16, 2026
Merged

Fix/improve default search json#51
cgoudet merged 4 commits intomainfrom
fix/improve_default_search_json

Conversation

@ThomGram
Copy link
Copy Markdown
Collaborator

@ThomGram ThomGram commented Apr 13, 2026

Améliorer le json hardcodé pour le front graphe

Petite PR pour améliorer ingestion/data_collection/default_search.json

Ce nouveau json contient des chunks et les metadata associées provenant de papiers du kdrive portant sur les vaccins. Certains chunks ne sont pas très parlant on pourrait les modifier mais ça reflète ce que renverrait le backend.

J'ai gardé la nomenclature documentée dans la doc

Copy link
Copy Markdown
Collaborator

@cgoudet cgoudet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Juste une histoire de typage mais ok sinon

"title": "...",
"date": "...",
"journal": "...",
"5": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je dirais que les id doivent être des entiers pour correspondre à l'id de la base de données.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si je ne me trompe pas, dans ce cas, il faudrait modifier la structure de la réponse, on ne peut pas mettre un int en key

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je sais pas si cela peut vous aider mais actuellement le front utilise ce fichier.

Copy link
Copy Markdown
Collaborator

@githubzey githubzey Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonsoir,

Pour info, comme je vais utiliser ce fichier pour côté front graph, pour tester j'ai pris le contenu du fichier de Thomas (déjà merci à lui pour cette version json) et j'ai remplacé avec le contenu du fichier que front utilise actuellement.(sans aucun autre changement et sur mon local)

  • J'ai une key error pour id 5, il ne voulait pas en int. Quand je les ai changé avec "5", il a accepté. Je crois que je dois changer le code app graph pour qu'il accepte les integer mais il les converti en string pour utiliser.
  • J'ai eu aussi un autre error KeyError: 'keywords'. Parce que dans fichier actuel, tous les chunks ont les keywords. Mais dans le fichier de cette PR les keywords sont dans la partie documents.
  • Pour l'instant je découvre le code de la partie dash app graph, donc je ne sais pas lequel est mieux. Mais dans le doc aussi les chunks ont des keywords.
  • Et j'ai une question ici, est-ce que tous les metadatas doivent être présents dans les chunks? Ou on doit modifier le code de app graph pour qu'il accepte même si tous ne sont pas dans les json des chunks ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merci pour tes commentaires. Concernant le key error, il me semble que pour un json le key doit être un string. Pour les keywords, je les garderais au niveau des documents, histoire de ne pas les répéter pour chaque chunk. Pour la dernière question, on peut imaginer que certaines metadata peuvent manquer. Il faut décider de ce qui est bloquant ou non. J'en discuterais plutôt sur mattermost au cas où afin d'avoir l'avis de tout le monde.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui, je parlais de document_id = 5, cette partie a donné une error chez moi. J'ai du changé comme document_id = "5" .

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok on garde les keys en string puisque json oblige. Par contre, comme tu as fait, on maintient aussi int dans le document_id du chunk pour la cohérence.

Copy link
Copy Markdown
Collaborator

@cgoudet cgoudet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cgoudet cgoudet merged commit 2b07e5d into main Apr 16, 2026
1 check passed
@cgoudet cgoudet deleted the fix/improve_default_search_json branch April 16, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants