backend-generator
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic links in README
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Unable to calculate vocabulary similarity
Last synced: 10 months ago
·
JSON representation
·
Repository
Basic Info
- Host: GitHub
- Owner: Rauls1306
- Language: Python
- Default Branch: main
- Size: 210 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Created about 1 year ago
· Last pushed 11 months ago
Metadata Files
Citation
Owner
- Login: Rauls1306
- Kind: user
- Repositories: 1
- Profile: https://github.com/Rauls1306
Citation (citation_generator.py)
# citation_generator.py
from typing import List, Dict
from generator_utils import generate_textual_citations, insert_citations_into_text
class CitationGenerator:
def __init__(self, title: str, generated_text: Dict[str, str]):
self.title = title
self.generated_text = generated_text
self.citations_by_block = {}
def generate_all_citations(self):
for key, text in self.generated_text.items():
if not isinstance(text, str):
print(f"❌ Error: el texto del bloque '{key}' no es string.")
continue
self.citations_by_block[key] = generate_textual_citations([text])
def insert_all_citations(self) -> Dict[str, str]:
final_text = {}
for key, text in self.generated_text.items():
if not isinstance(text, str):
print(f"❌ Error: el texto del bloque '{key}' no es string.")
continue
citations = self.citations_by_block.get(key, [])
if not citations:
print(f"⚠️ Advertencia: No hay citas para el bloque '{key}'. Usando cita simulada.")
citations = ["(Fuente simulada, 2024)"]
try:
final_text[key] = insert_citations_into_text(text, citations)
except Exception as e:
print(f"❌ Error al insertar citas en '{key}': {e}")
final_text[key] = text
return final_text
GitHub Events
Total
- Member event: 1
- Push event: 83
- Create event: 1
Last Year
- Member event: 1
- Push event: 83
- Create event: 1
Dependencies
requirements.txt
pypi
- fastapi *
- openai ==0.28
- python-docx *
- uvicorn *