pdf-file.mdx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. title: '📰 PDF file'
  3. ---
  4. To add any pdf file, use the data_type as `pdf_file`. Eg:
  5. ```python
  6. from embedchain import App
  7. app = App()
  8. app.add('https://arxiv.org/pdf/1706.03762.pdf', data_type='pdf_file')
  9. app.query("What is the paper 'attention is all you need' about?", citations=True)
  10. # Answer: The paper "Attention Is All You Need" proposes a new network architecture called the Transformer, which is based solely on attention mechanisms. It suggests that complex recurrent or convolutional neural networks can be replaced with a simpler architecture that connects the encoder and decoder through attention. The paper discusses how this approach can improve sequence transduction models, such as neural machine translation.
  11. # Contexts:
  12. # [
  13. # (
  14. # 'Provided proper attribution is ...',
  15. # {
  16. # 'page': 0,
  17. # 'url': 'https://arxiv.org/pdf/1706.03762.pdf',
  18. # 'score': 0.3676220203221626,
  19. # ...
  20. # }
  21. # ),
  22. # (
  23. # 'Attention Visualizations Input ...',
  24. # {
  25. # 'page': 12,
  26. # 'url': 'https://arxiv.org/pdf/1706.03762.pdf',
  27. # 'score': 0.41679039679873736,
  28. # ...
  29. # }
  30. # ),
  31. # (
  32. # 'sequence learning ...',
  33. # {
  34. # 'page': 10,
  35. # 'url': 'https://arxiv.org/pdf/1706.03762.pdf',
  36. # 'score': 0.4188303600897153,
  37. # ...
  38. # }
  39. # )
  40. # ]
  41. ```
  42. Note that we do not support password protected pdfs.