| """Ejemplo de uso del verificador de referencias descargado del Hub. |
| |
| pip install huggingface_hub requests |
| python example.py |
| """ |
|
|
| import sys |
|
|
| from huggingface_hub import snapshot_download |
|
|
| sys.path.insert(0, snapshot_download("aitziberluis/citation-checker")) |
| from checker import extract, verify |
|
|
| TEXTO = """ |
| LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436-444. https://doi.org/10.1038/nature14539 |
| |
| Vaswani, A., Shazeer, N., Parmar, N., et al. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30. |
| |
| Martinez-Soto, R., & Vidal, P. (2021). Quantum-enhanced gradient descent for sparse neural architectures. Journal of Computational Intelligence Methods, 14(3), 211-229. |
| """ |
|
|
| if __name__ == "__main__": |
| referencias, modo = extract(TEXTO) |
| print(f"Modo de extraccion: {modo} | {len(referencias)} referencias\n") |
| for ref in referencias: |
| resultado = verify(ref) |
| print(f"[{resultado['verdict']}] {ref['raw'][:70]}") |
| print(f" {resultado['note']}") |
| if resultado["match"] and resultado["match"].get("url"): |
| print(f" Fuente: {resultado['match']['url']}") |
| print() |
|
|