Answers.Body: <p>While they currently support fine-tuning with JSON files in the form of Q&amp;A pairs, your ML pipeline can preprocess your documents using tools like <a href="https://pypi.org/project/PyPDF2/" rel="nofollow noreferrer">PyPDF2</a> for non-scanned PDFs, <a href="https://pypi.org/project/python-docx/" rel="nofollow noreferrer">python-docx</a> for Word files, or <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html" rel="nofollow noreferrer">pandas</a> for CSV/XLS, etc, which is a programming question and can be more or less achieved through some effort. However, fine-tuning is limited to textual data.</p>
  <p><a href="https://js.langchain.com/docs/integrations/document_loaders/" rel="nofollow noreferrer">LangChain</a> could be a high-level framework to build your pipeline for various types of document loading and pairing.</p>
  <blockquote>
  <p>LangChain.js categorizes document loaders in two different ways:
  File loaders, which load data into LangChain formats from your local filesystem.
  Web loaders, which load data from remote sources.</p>
  </blockquote>
  <blockquote>
  <p>These loaders are used to load files given a filesystem path or a Blob object... This notebook provides a quick overview for getting started with PDFLoader document loaders.</p>
  </blockquote>
  <p>Azure is a cloud SaaS vendor to allow RAG and fine-tuning pre-trained OpenAI models while integrating with its Cognitive Search to index and query diverse document formats including scanned PDFs and tabular data.</p>
  <p>Finally since you want to query and analyze company data, it's possible to do it locally with your own chosen LLM via Hugging Face trainer or LoRA APIs and the best approach would likely combine RAG and fine-tuning. RAG indexes your documents using a vector database like Pinecone or Elasticsearch then your LLM retrieves context-relevant information during a query, especially suitable for tasks such as your concerned customer-specific product recommendations ChatBot which needs to retrieve large amounts of data dynamically from a knowledge base. Fine-tuning is used for highly domain specific tasks such as your concerned scoring customers or anomalies, and it can even add additional regression or classification head for regression (e.g., scoring customer) or classification (e.g., categorizing user intent) model, respectively.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-21T11:12:28.387Z
Answers.Text: Questions asking for tools are off-topic here, so we shouldn't be answering them, but just vote to close them. We focus on theoretical, philosophical and social aspects of AI. See https://ai.stackexchange.com/help/on-topic for more info.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-20T06:42:25.383Z
Answers.LastActivityDate: 2024-11-20T06:42:25.383Z
Answers.UserDisplayName: cinch
Body: <p>Let's say I have a company X. I have a lot of documents in it: financial, HR, strategies, procedures, customer information and many more. These documents are in different formats: PDF (textual, tabular (including invoices), scanned), DOC, XLS/CSV, XML, maybe HTML.</p>
  <p>Which platform would be the best to:</p>
  <ol>
  <li>Create an own model (based on some pre-trained model).</li>
  <li>Tune it with the company documents.</li>
  <li>Ask questions about the company information, also in relation to the market.</li>
  <li>(optional) Do 2&amp;3 programmatically (via API).</li>
  </ol>
  <p>I tested (or read a lot of documentation for some) ChatGPT, Claude, Google Gemini, Fireworks, Together.ai. But all of them only allow to be fine-tuned by the JSON files (in the form of question-answer pairs) and don't allow to upload files in other formats. The only thing I found were <a href="https://platform.openai.com/docs/assistants/overview" rel="nofollow noreferrer">OpenAI's Assistants</a> and I need to look more into it but it still doesn't allow to interpret PDF files (I would need to parse PDF files manually which I would like to avoid).</p>
  <p>Sample questions I would like to ask and get answer to:</p>
  <ul>
  <li>Customer related: What is our biggest customer? List all customers that often pay invoices after due date. Compare incomes with costs. Which customers should we encourage to buy more and how? etc.</li>
  <li>Market related: Compare our incomes to competitors. List all biggest competitors. Which sector are we operating in and what are the perspectives for it? etc.</li>
  <li>Questions from customers: Describe me product XXX. What are my latest invoices I need to pay? Show me the amount I spent in the company in the past quarters. etc.</li>
  </ul>
  <p>Bonus question: is it possible to do it locally (Llama, phi etc.)?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-11-21T11:13:42.143Z
Comments.Text: Questions asking for tools or which tools to use are off-topic here. We focus on theoretical, philosophical and social aspects of AI. See https://ai.stackexchange.com/help/on-topic for more info.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-11-22T12:03:00.223Z
Comments.Text: Where to ask them instead? Stackoverflow?
Comments.UserDisplayName: bpiec
Tags: <large-language-models><gpt>
Title: Platform for building own model pupulated by own data
UserDisplayName: bpiec
ThreadText: # Platform for building own model pupulated by own data
  
  (Asked by: username_0 on 2024-11-19)
  
  Let's say I have a company X. I have a lot of documents in it: financial, HR, strategies, procedures, customer information and many more. These documents are in different formats: PDF (textual, tabular (including invoices), scanned), DOC, XLS/CSV, XML, maybe HTML.
  
  Which platform would be the best to:
  
  1. Create an own model (based on some pre-trained model).
  2. Tune it with the company documents.
  3. Ask questions about the company information, also in relation to the market.
  4. (optional) Do 2&3 programmatically (via API).
  
  I tested (or read a lot of documentation for some) ChatGPT, Claude, Google Gemini, Fireworks, Together.ai. But all of them only allow to be fine-tuned by the JSON files (in the form of question-answer pairs) and don't allow to upload files in other formats. The only thing I found were [OpenAI's Assistants](https://platform.openai.com/docs/assistants/overview) and I need to look more into it but it still doesn't allow to interpret PDF files (I would need to parse PDF files manually which I would like to avoid).
  
  Sample questions I would like to ask and get answer to:
  
  * Customer related: What is our biggest customer? List all customers that often pay invoices after due date. Compare incomes with costs. Which customers should we encourage to buy more and how? etc.
  * Market related: Compare our incomes to competitors. List all biggest competitors. Which sector are we operating in and what are the perspectives for it? etc.
  * Questions from customers: Describe me product XXX. What are my latest invoices I need to pay? Show me the amount I spent in the company in the past quarters. etc.
  
  Bonus question: is it possible to do it locally (Llama, phi etc.)?
  
  **Tags:** large-language-models, gpt
  
  > **Comments:**
  > **username_1**: Questions asking for tools or which tools to use are off-topic here. We focus on theoretical, philosophical and social aspects of AI. See https://ai.stackexchange.com/help/on-topic for more info.  
  > **username_0**: Where to ask them instead? Stackoverflow?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-11-20. Score: 1
  
  While they currently support fine-tuning with JSON files in the form of Q&A pairs, your ML pipeline can preprocess your documents using tools like [PyPDF2](https://pypi.org/project/PyPDF2/) for non-scanned PDFs, [python-docx](https://pypi.org/project/python-docx/) for Word files, or [pandas](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html) for CSV/XLS, etc, which is a programming question and can be more or less achieved through some effort. However, fine-tuning is limited to textual data.
  
  [LangChain](https://js.langchain.com/docs/integrations/document_loaders/) could be a high-level framework to build your pipeline for various types of document loading and pairing.
  
  > LangChain.js categorizes document loaders in two different ways:
  > File loaders, which load data into LangChain formats from your local filesystem.
  > Web loaders, which load data from remote sources.
  
  > These loaders are used to load files given a filesystem path or a Blob object... This notebook provides a quick overview for getting started with PDFLoader document loaders.
  
  Azure is a cloud SaaS vendor to allow RAG and fine-tuning pre-trained OpenAI models while integrating with its Cognitive Search to index and query diverse document formats including scanned PDFs and tabular data.
  
  Finally since you want to query and analyze company data, it's possible to do it locally with your own chosen LLM via Hugging Face trainer or LoRA APIs and the best approach would likely combine RAG and fine-tuning. RAG indexes your documents using a vector database like Pinecone or Elasticsearch then your LLM retrieves context-relevant information during a query, especially suitable for tasks such as your concerned customer-specific product recommendations ChatBot which needs to retrieve large amounts of data dynamically from a knowledge base. Fine-tuning is used for highly domain specific tasks such as your concerned scoring customers or anomalies, and it can even add additional regression or classification head for regression (e.g., scoring customer) or classification (e.g., categorizing user intent) model, respectively.
  
  > **Comments:**
  > **username_1**: Questions asking for tools are off-topic here, so we shouldn't be answering them, but just vote to close them. We focus on theoretical, philosophical and social aspects of AI. See https://ai.stackexchange.com/help/on-topic for more info.  
  
  ---
  
  