NLP System for Automation of Document Workflow in a Research and Development Organization—A Case Study
Featured Application
Abstract
1. Introduction
- The architecture and tools for the development of an agent-based system for an R&D organization have been proposed.
- The optimization of LLM model selection for a specific task is presented.
- The pilot deployment of the LLM-based solution was elaborated and presented.
2. Materials and Methods
2.1. General Assumptions
- The system should help in processing the most tedious and work-consuming documents.
- Most documents may contain sensitive or commercially confidential data.
- The processing workflow depends on the document type, as does the information retrieved from it.
- The system is intended to expose its functionality via API.
- The regulations of AI and, particularly, LLM usage in the organization have to be developed.
2.2. NLP System Architecture and Design
- Extraction: In this step, the text information is extracted from the document. Cleaning of the text is performed (removal of empty lines, removal of non-textual chars, etc.).
- Document type classification: The type of document is determined based on its content. The result document is classified into one of the classes described in Table 1.
- Processing: The document text analysis is performed in this step. The exact operations performed are dependent on the document type.
- Final response generation: In this step, the final form of system output is generated. There are two formats considered: Markdown for human-readable output and JSON as a format most convenient for exchanging with other systems working in the institute.
2.3. Infrastructure
- The LLM model (or models) is run at a dedicated server with at least one dedicated GPU card (an LLM server—for detailed configuration see Appendix B).
- The solution is deployed at one of the available servers (solution server—different from the LLM server).
- The communication between the solution server and the LLM server is provided by a wide-band, high-performance network connection.
- The solution server is the only one allowed to connect and use the resources of the LLM server, which is enforced by network configurations.
- The external systems connect to the solution server using the exposed Web API. The security checks apply; the list of servers hosting external systems allowed to connect to the solution server is limited.
- The filesystem resources of the solution server are used for document and Markdown/JSON files’ storage.
- No backup of processed files is done on the solution server; external systems are responsible for this task.
2.4. System Development
2.5. Organizational and Formal Considerations
3. Results
3.1. Document Classification and Dynamic Routing Performance
3.2. Multi-Stage Structured Data Extraction from Scientific Papers
3.3. The Heterogeneous Model Assignments
3.4. Text Mining—Structured Output Generation
4. Discussion
4.1. Classification Dilemma—Compromise Between Accuracy and Time Efficiency
4.2. Comparative Perspective—The Challenge of Assessment Without Standards
4.3. Data Extraction and Summarization—The Fight for Relevant Context Content
4.4. Heterogeneous Models Usage—The Lessons Learned
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
| AI | Artificial Intelligence |
| API | Application Programming Interface |
| CI/CD | Continuous Integration and Continuous Deployment |
| DOI | Digital Object Identifier |
| ERP | Enterprise Resource Planning |
| GIG-NRI | GIG National Research Institute |
| IDE | Integrated Development Environment |
| IF | Impact Factor |
| ISO | International Organization for Standardization |
| IT | Information Technology |
| JSON | JavaScript Object Notation |
| JSONC | JSON with Comments |
| LLM | Large Language Model |
| ML | Machine Learning |
| MVP | Minimum Viable Product |
| NLP | Natural Language Processing |
| R&D | Research and Development |
| RAG | Retrieval-Augmented Generation |
Appendix A
Appendix A.1. Pseudocode for Classification Efficiency Assessment
| Define PROMPT_TO_TEST with instructions for the LLM Select MODEL_TO_TEST (e.g., “magistral:24b”) Build the classification chain: Initialize ChatOllama with the selected model Set up JsonOutputParser with the classification schema Create a prompt template integrating the instructions and schema Chain = Prompt -> LLM -> Parser // Document Processing Loop Initialize an empty list ‘results’ Set dataset path to documents folder For each category_folder in dataset_path: Get true_label from folder name For each document_file in category_folder: // Text Extraction Initialize extraction state with file path Run text extraction node (handles PDF/DOCX reading) Get document_text // Default state Set predicted_label = “classification_failed” If document_text is not empty: Try: // Classification Prepare input: document_text Invoke classification chain with input predicted_label = response.document_type classification_status = “success” Catch Exception json.JSONDecodeError: Log error classification_status = “parse_error” predicted_label = “system_error” Catch Exception ValidationError as e: Log error classification_status = “validation_error” predicted_label = “system_error” Catch Exception: Log error classification_status = “infrastructure_error” predicted_label = “system_error” else: classification_status = “no_text” predicted_label = “system_error” // Store Result Append {filename, true_label, predicted_label, classification_status} to ‘results’ // Evaluation and Reporting Convert ‘results’ to a DataFrame Calculate Overall Accuracy: Compare true_labels vs. predicted_labels (Total Correct/Total Processed) Generate Classification Report: Calculate Precision, Recall, F1-Score for each class |
Appendix A.2. Prompt Used for Classification Task
| ##### You are an expert in document classification. Your task is to analyze the beginning of the following text and determine its category. Think of your decision, analyze the text carefully, step by step, and then provide your answer. You must classify the document into one of the available types. Respond with only the name of the category. \ If the document does not clearly belong to any of the specific categories—for example, if it is a book, CV, instruction manual, or the text is of poor quality, ill-structured, or otherwise unrecognizable—classify it as “other”. {format_instructions} Text for classification: --- {text_to_analyze} --- ##### |
Appendix A.3. Configuration Parameters and Settings
| Parameter: | Value: |
| model | Model name, e.g., “gemma3:27b” |
| format | “json” |
| temperature | 0.0 |
| K | 40 |
| p | 0.9 |
| context window size | 16384 |
| base_url | “<Ollama server URL>” |
| Reasoning | False |
llm = ChatOllama(model=model_name, format=“json”, temperature=0, num_ctx=16384, base_url=“<Ollama server URL>“, reasoning=False) |
Appendix A.4. Code Snippets for the Core Text Classification Components
def build_test_chain(model_name: str, prompt_template: str): llm = ChatOllama(model=model_name, format=“json”, temperature=0, base_url=“<Ollama server URL>“, reasoning=False) parser = JsonOutputParser(pydantic_object=DocumentClassification) format_instructions = get_custom_format_instructions(DocumentClassification) prompt = ChatPromptTemplate.from_template( template=prompt_template, partial_variables={“format_instructions”: format_instructions},
) return prompt | llm | parser |
initial_state = GraphState(file_path=file_path_str) extraction_result = route_extraction_node(initial_state) text_content = extraction_result.get(“document_text”, ““) predicted_label = “classification_failed” if text_content: try: response = test_classification_chain.invoke({
“text_to_analyze”: text_content}) predicted_label = response.get(“document_type”, “other”) classification_status = “success” except (json.JSONDecodeError, KeyError) as e: classification_status = “parse_error” predicted_label = “other” print(f”WARN: Parse error for {filename} run {run_idx}: {e}”)
except ValidationError as e: classification_status = “validation_error” predicted_label = “other” print(f”WARN: Validation error for {filename} run {run_idx}: {e}”)
except Exception as e: error_str = str(e).lower() if “output parsing” in error_str or “invalid json” in error_str or “expected value” in error_str: classification_status = “parse_error” predicted_label = “other” else: classification_status = “infrastructure_error” predicted_label = “classification_failed” print(f”ERROR: {filename} run {run_idx}: {e}”)
else: classification_status = “no_text” predicted_label = “classification_failed” results.append({
“filename”: filename, “true_label”: true_label, “predicted_label”: predicted_label, “classification_status”: classification_status, }) |
Appendix B
- Manufacturer Dell Inc.
- Model PowerEdge R760
- 32 CPUs x INTEL(R) XEON(R) GOLD 6526Y
- Memory 128 GB
- 2xNvidiaL40S 48 GB VRAM
Appendix C
| Model Name | Parameters | Context Length | Embedding Length | Quantization |
| cogito:70b | 70.6B | 131072 | 8192 | Q4_K_M |
| deepseek-r1:70b | 70.6B | 131072 | 8192 | Q4_K_M |
| devstral:24b-small-2505-q8_0 | 23.6B | 131072 | 5120 | Q8_0 |
| gemma3:27b-it-q8_0 | 27.4B | 131072 | 5376 | Q8_0 |
| granite4:small-h | 32.2B | 1048576 | 4096 | Q4_K_M |
| llama3.1:70b | 70.6B | 131072 | 8192 | Q4_K_M |
| llama3.1:latest | 8.0B | 131072 | 4096 | Q4_K_M |
| llama3.3:latest | 70.6B | 131072 | 8192 | Q4_K_M |
| magistral:latest | 23.6B | 40000 | 5120 | Q4_K_M |
| mistral-small3.1:24b-instruct-2503-fp16 | 24.0B | 131072 | 5120 | F16 |
| qwen2.5:72b | 72.7B | 32768 | 8192 | Q4_K_M |
| qwen3:32b-q8_0 | 32.8B | 40960 | 5120 | Q8_0 |
References
- Jeong, C. A Study on the Implementation of Generative AI Services Using an Enterprise Data-Based LLM Application Architecture. Adv. Artif. Intell. Mach. Learn. 2023, 3, 1588–1618. [Google Scholar] [CrossRef]
- Hikov, A.; Murphy, L. Information Retrieval from Textual Data: Harnessing Large Language Models, Retrieval Augmented Generation and Prompt Engineering. J. AI Robot. Workplace Autom. 2024, 3, 142–150. [Google Scholar] [CrossRef]
- Yuksel, K.; Sawaf, H. A Multi-AI Agent System for Autonomous Optimization of Agentic AI Solutions via Iterative Refinement and LLM-Driven Feedback Loops. arXiv 2024, arXiv:2412.17149. [Google Scholar] [CrossRef]
- Wang, Z.; Cui, Y.; Zhong, L.; Zhang, Z.; Yin, D.; Lin, B.Y.; Shang, J. OfficeBench: Benchmarking Language Agents across Multiple Applications for Office Automation. arXiv 2024, arXiv:2407.19056. [Google Scholar] [CrossRef]
- Nazi, Z.A.; Peng, W. Large Language Models in Healthcare and Medical Domain: A Review. Informatics 2023, 11, 57. [Google Scholar] [CrossRef]
- Siino, M.; Falco, M.; Croce, D.; Rosso, P. Exploring LLMs Applications in Law: A Literature Review on Current Legal NLP Approaches. IEEE Access 2025, 13, 18253–18276. [Google Scholar] [CrossRef]
- Płonka, M.; Kocot, K.; Hołda, K.; Daniec, K.; Nawrat, A. A Comparative Evaluation of the Effectiveness of Document Splitters for Large Language Models in Legal Contexts. Expert Syst. Appl. 2025, 272, 126711. [Google Scholar] [CrossRef]
- Musumeci, E.; Brienza, M.; Suriani, V.; Nardi, D.; Bloisi, D. LLM Based Multi-Agent Generation of Semi-Structured Documents from Semantic Templates in the Public Administration Domain. arXiv 2024, arXiv:2402.14871. [Google Scholar] [CrossRef]
- Garcia, C.I.; DiBattista, M.A.; Letelier, T.A.; Halloran, H.D.; Camelio, J. Framework for LLM Applications in Manufacturing. Manuf. Lett. 2024, 41, 253–263. [Google Scholar] [CrossRef]
- Tripathi, S.; Sukumaran, R.; Cook, T.S. Efficient Healthcare with Large Language Models: Optimizing Clinical Workflow and Enhancing Patient Care. J. Am. Med. Inform. Assoc. JAMIA 2024, 31, 1436–1440. [Google Scholar] [CrossRef]
- Harrer, S. Attention Is Not All You Need: The Complicated Case of Ethically Using Large Language Models in Healthcare and Medicine. eBioMedicine 2023, 90, 104512. [Google Scholar] [CrossRef]
- Haltaufderheide, J.; Ranisch, R. The Ethics of ChatGPT in Medicine and Healthcare: A Systematic Review on Large Language Models (LLMs). npj Digit. Med. 2024, 7, 183. [Google Scholar] [CrossRef] [PubMed]
- Gencer, G.; Gencer, K. Large Language Models in Healthcare: A Bibliometric Analysis and Examination of Research Trends. J. Multidiscip. Healthc. 2025, 18, 223–238. [Google Scholar] [CrossRef]
- Liu, Q.; Yang, R.; Gao, Q.; Liang, T.; Wang, X.; Li, S.; Lei, B.; Gao, K. A Review of Applying Large Language Models in Healthcare. IEEE Access 2025, 13, 6878–6892. [Google Scholar] [CrossRef]
- Cascella, M.; Semeraro, F.; Montomoli, J.; Bellini, V.; Piazza, O.; Bignami, E. The Breakthrough of Large Language Models Release for Medical Applications: 1-Year Timeline and Perspectives. J. Med. Syst. 2024, 48, 22. [Google Scholar] [CrossRef]
- Lorencin, I.; Tanković, N.; Etinger, D. Optimizing Healthcare Efficiency with Local Large Language Models. AHFE Int. 2025, 160, 576–584. [Google Scholar] [CrossRef]
- Xu, Q. Practical Applications of Large Language Models in Enterprise-Level Applications. J. Comput. Sci. Artif. Intell. 2025, 2, 17–21. [Google Scholar] [CrossRef]
- Musunuri, A. Enterprise Data Security and Integration with LLMs. Int. J. Innov. Res. Sci. Eng. Technol. 2025, 14, 81391435. [Google Scholar] [CrossRef]
- Some, L.; Yang, W.; Bain, M.; Kang, B. A Comprehensive Survey on Integrating Large Language Models with Knowledge-Based Methods. Knowl. Based Syst. 2025, 318, 113503. [Google Scholar] [CrossRef]
- Mahr, F.; Angeli, G.; Sindel, T.; Schmidt, K.; Franke, J. A Reference Architecture for Deploying Large Language Model Applications in Industrial Environments. In Proceedings of the 2024 IEEE 30th International Symposium for Design and Technology in Electronic Packaging (SIITME), Sibiu, Romania, 16–19 October 2024; pp. 19–23. [Google Scholar] [CrossRef]
- Cappel, J.; Chasin, F. Bridging Enterprise Knowledge Management and Natural Language Processing—Integration Framework and a Prototype. In Proceedings of the International Conference on Design Science Research in Information Systems and Technology; Springer: Cham, Switzerland, 2024; pp. 278–294. [Google Scholar] [CrossRef]
- Bodensohn, J.-M.; Brackmann, U.; Vogel, L.; Sanghi, A.; Binnig, C. Unveiling Challenges for LLMs in Enterprise Data Engineering. arXiv 2025, arXiv:2504.10950. [Google Scholar] [CrossRef]
- Friha, O.; Ferrag, M.A.; Kantarci, B.; Cakmak, B.; Ozgun, A.; Ghoualmi-Zine, N. LLM-Based Edge Intelligence: A Comprehensive Survey on Architectures, Applications, Security and Trustworthiness. IEEE Open J. Commun. Soc. 2024, 5, 5799–5856. [Google Scholar] [CrossRef]
- Yang, J.; Jin, H.; Tang, R.; Han, X.; Feng, Q.; Jiang, H.; Yin, B.; Hu, X. Harnessing the Power of LLMs in Practice: A Survey on ChatGPT and Beyond. ACM Trans. Knowl. Discov. Data 2023, 18, 1–32. [Google Scholar] [CrossRef]
- Khaldy, M.A.; Gheraibia, Y. Evaluation and Mitigation of the Limitations of Large Language Models in Business Decision-Making. In Proceedings of the 2025 1st International Conference on Computational Intelligence Approaches and Applications (ICCIAA), Amman, Jordan, 28–30 April 2025; pp. 1–6. [Google Scholar] [CrossRef]
- Holtzman, A.; Buys, J.; Du, L.; Forbes, M.; Choi, Y. The Curious Case of Neural Text Degeneration. arXiv 2019, arXiv:1904.09751. [Google Scholar]
- Ji, Z.; Lee, N.; Frieske, R.; Yu, T.; Su, D.; Xu, Y.; Ishii, E.; Bang, Y.J.; Madotto, A.; Fung, P. Survey of Hallucination in Natural Language Generation. ACM Comput. Surv. 2023, 55, 1–38. [Google Scholar] [CrossRef]
- Rurański, J.; Nowak, K.; Góras, M.; Dworak, K.; Nurzyńska, K. How to Moderate LLM Based Chats from Hallucinations? In Proceedings of the 33rd International Conference on Information Systems Development (ISD2025); Faculty of Organizational Sciences, University of Belgrade: Belgrade, Serbia, 2025. [Google Scholar]
- Yang, L.; Dan, I.; Xu, Y.; Shuohang, W.; Xu, R.; Chenguang, Z. Gpteval: Nlg Evaluation Using Gpt-4 with Better Human Alignment. arXiv 2023, arXiv:2303.16634. [Google Scholar]
- Gu, J.; Jiang, X.; Shi, Z.; Tan, H.; Zhai, X.; Xu, C.; Li, W.; Shen, Y.; Ma, S.; Liu, H.; et al. A Survey on LLM-as-a-Judge. Innovation 2026, 7, 10125. [Google Scholar] [CrossRef]
- Shan, R.; Shan, T. Enterprise LLMOps: Advancing Large Language Models Operations Practice. In Proceedings of the 2024 IEEE Cloud Summit, Washington, DC, USA, 27–28 June 2024; pp. 143–148. [Google Scholar] [CrossRef]
- Marcondes, F.S.; Gala, A.; Magalhães, R.; Perez de Britto, F.; Durães, D.; Novais, P. Using Ollama. In Natural Language Analytics with Generative Large-Language Models: A Practical Approach with Ollama and Open-Source LLMs; Springer Nature: Cham, Switzerland, 2025; pp. 23–35. ISBN 978-3-031-76631-2. [Google Scholar]
- Liu, F.; Kang, Z.; Han, X. Optimizing RAG Techniques for Automotive Industry PDF Chatbots: A Case Study with Locally Deployed Ollama Models. In Proceedings of the 2024 3rd International Conference on Artificial Intelligence and Intelligent Information Processing, Tianjin, China, 26–27 October 2025; Association for Computing Machinery: New York, NY, USA, 2025; pp. 152–159. [Google Scholar]
- Mandulapalli, S.; Hernandez, E.; Hall, W.J.; Chakeri, A.; Jaimes, L. Development of Agentic Workflows with LangGraph for Software Development Life Cycle Automation. In Proceedings of the North American Conference on Industrial Engineering and Operations Management-Computer Science Tracks, Orlando, FL, USA, 17–19 June 2025; Springer: Berlin/Heidelberg, Germany, 2025; pp. 45–54. [Google Scholar]
- Wang, J.; Duan, Z. Agent Ai with Langgraph: A Modular Framework for Enhancing Machine Translation Using Large Language Models. arXiv 2024, arXiv:2412.03801. [Google Scholar] [CrossRef]
- Chen, H.; Ding, Y. Implementing Traffic Agent Based on LangGraph. In Proceedings of the Fourth International Conference on Intelligent Traffic Systems and Smart City (ITSSC 2024), Xi’an, China, 23–25 August 2024; SPIE: Bellingham, WA, USA, 2025; Volume 13422, pp. 582–587. [Google Scholar]
- Annam, S.; Saxena, M.; Kaushik, U.; Mittal, S. LangChain: Simplifying Development with Language Models. In Textual Intelligence: Large Language Models and Their Real-World Applications; Wiley: Hoboken, NJ, USA, 2025; pp. 287–304. [Google Scholar] [CrossRef]
- Mavroudis, V. LangChain v0.3. 2024. Available online: https://hal.science/hal-04817573/document (accessed on 14 April 2026).
- Pelluru, K. LangChain & LangGraph in Production: Architectures for Multi-Agent LLM Systems. J. Data Digit. Innov. JDDI 2025, 2, 1–9. [Google Scholar]
- Ravathanallur Chackrvarti, S. Optimizing AI-Powered Workflows for Seamless Automation: An Integrated Framework Using LangGraph, Pydantic, and React. 15 July 2025. Available online: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5388103 (accessed on 16 April 2026).
- Narayanan, P.K. Getting Started with Data Validation Using Pydantic and Pandera. In Data Engineering for Machine Learning Pipelines: From Python Libraries to ML Pipelines and Cloud Platforms; Springer: Berlin/Heidelberg, Germany, 2024; pp. 163–196. [Google Scholar]
- Bendale, A.; Boult, T. Towards Open World Recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; 2015; pp. 1893–1902. Available online: https://www.cv-foundation.org/openaccess/content_cvpr_2015/papers/Bendale_Towards_Open_World_2015_CVPR_paper.pdf (accessed on 16 April 2026).
- Salton, G.; Buckley, C. Term-Weighting Approaches in Automatic Text Retrieval. Inf. Process. Manag. 1988, 24, 513–523. [Google Scholar] [CrossRef]
- Cortes, C.; Vapnik, V. Support-Vector Networks. Mach. Learn. 1995, 20, 273–297. [Google Scholar] [CrossRef]
- Joachims, T. Text Categorization with Support Vector Machines: Learning with Many Relevant Features. In Proceedings of the 10th European Conference on Machine Learning (ECML 1998); Springer: Berlin/Heidelberg, Germany, 1998; pp. 137–142. [Google Scholar]
- Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
- Scheirer, W.J.; de Rezende Rocha, A.; Sapkota, A.; Boult, T.E. Toward Open Set Recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2013, 35, 1757–1772. [Google Scholar] [CrossRef]
- Yin, W.; Hay, J.; Roth, D. Benchmarking Zero-Shot Text Classification: Datasets, Evaluation and Entailment Approach. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, 3–7 November 2019; pp. 3914–3923. [Google Scholar]
- Serbanescu, V.-A.; Dhali, M.A. Deep Learning for Effective Classification and Information Extraction of Financial Documents. In Proceedings of the 14th International Conference on Pattern Recognition Applications and Methods—ICPRAM; SciTePress: Setúbal, Portugal, 2025; pp. 749–756. [Google Scholar] [CrossRef]
- Fleiss, J.L. Measuring Nominal Scale Agreement among Many Raters. Psychol. Bull. 1971, 76, 378. [Google Scholar] [CrossRef]
- Landis, J.R.; Koch, G.G. The Measurement of Observer Agreement for Categorical Data. Biometrics 1977, 159–174. [Google Scholar] [CrossRef]
- Cohen, J. A Coefficient of Agreement for Nominal Scales. Educ. Psychol. Meas. 1960, 20, 37–46. [Google Scholar] [CrossRef]
- Liu, Y.; Lo, S.K.; Lu, Q.; Zhu, L.; Zhao, D.; Xu, X.; Harrer, S.; Whittle, J. Agent Design Pattern Catalogue: A Collection of Architectural Patterns for Foundation Model Based Agents. J. Syst. Softw. 2025, 220, 112278. [Google Scholar] [CrossRef]
- Lewis, P.R.; Sarkadi, Ş. Reflective Artificial Intelligence. Minds Mach. 2024, 34, 14. [Google Scholar] [CrossRef]
- Zhang, Y.; Wang, M.; Li, Q.; Tiwari, P.; Qin, J. Pushing the Limit of LLM Capacity for Text Classification. In Proceedings of the Companion Proceedings of the ACM on Web Conference, Sydney, Australia, 28 April–2 May 2025; pp. 1524–1528. [Google Scholar]
- Socher, R.; Perelygin, A.; Wu, J.; Chuang, J.; Manning, C.D.; Ng, A.Y.; Potts, C. Recursive Deep Models for Semantic Compositionality over a Sentiment Treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, Seattle, WA, USA, 18–21 October 2013; pp. 1631–1642. [Google Scholar]
- Zhang, X.; Zhao, J.; LeCun, Y. Character-Level Convolutional Networks for Text Classification. Adv. Neural Inf. Process. Syst. 2015, 28. Available online: https://proceedings.neurips.cc/paper_files/paper/2015/file/250cf8b51c773f3f8dc8b4be867a9a02-Paper.pdf (accessed on 16 April 2026).
- Pang, B.; Lee, L.; Vaithyanathan, S. Thumbs up? Sentiment Classification Using Machine Learning Techniques. In Proceedings of the ACL-02 Conference on Empirical Methods in Natural Language Processing—Volume 10; Association for Computational Linguistics: Stroudsburg, PA, USA, 2002; pp. 79–86. [Google Scholar]
- Vajjala, S.; Shimangaud, S. Text Classification in the LLM Era–Where Do We Stand? arXiv 2025, arXiv:2502.11830. [Google Scholar]
- Harley, A.W.; Ufkes, A.; Derpanis, K.G. Evaluation of Deep Convolutional Nets for Document Image Classification and Retrieval. In Proceedings of the International Conference on Document Analysis and Recognition (ICDAR), Nancy, France, 23–26 August 2015. [Google Scholar]
- Larson, S.; Lim, G.; Leach, K. On Evaluation of Document Classification Using RVL-CDIP. arXiv 2023, arXiv:2306.12550. [Google Scholar] [CrossRef]
- Landeghem, J.V.; Biswas, S.; Blaschko, M.B.; Moens, M. Beyond Document Page Classification: Design, Datasets, and Challenges. In Proceedings of the 2024 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), Waikoloa, HI, USA, 3–8 January 2023; pp. 2950–2960. [Google Scholar] [CrossRef]
- Xia, R.; Mao, S.; Yan, X.; Zhou, H.; Zhang, B.; Peng, H.; Pi, J.; Fu, D.; Wu, W.; Ye, H.; et al. DocGenome: An Open Large-Scale Scientific Document Benchmark for Training and Testing Multi-Modal Large Language Models. arXiv 2024, arXiv:2406.11633. [Google Scholar] [CrossRef]
- Park, H.H.; Vyas, Y.; Shah, K. Efficient Classification of Long Documents Using Transformers. arXiv 2022, arXiv:2203.11258. [Google Scholar] [CrossRef]








| Document Type | Information Extracted/Processing |
|---|---|
| Invoice | Extraction of: order value, tax, payment deadline, overdue payment flag, number of items, invoice ID, issue date, date of service/delivery, client identification data, payer identification data. |
| Contract | Extraction of: parties to the agreement, subject of the agreement, contract date, terms of execution, contractual penalties. |
| Scientific Article | Extraction of: title, authors, affiliations, publication date, journal, DOI. Generation of abstract and keywords. Determination of Impact Factor—IF. |
| Tender Specification Document | Extraction of: subject of the order, contracting authority, technical requirements, eligibility requirements, required references, bid bond/tender security, estimated order value based on the bid bond, submission deadline, required formal documents, terms of contract execution, warranty conditions, contractual penalties, service level requirements. |
| Plagiarism Detection Report | Extraction of: title, authors, Classification of reports outcome (evaluation result) into one of the classes: plagiarism, requires clarification, OK. |
| ISO Procedure Document | Identification of the relevant procedure and verification of compliance with the document template. |
| Other | No processing; user decision required. |
| Method | Exposed Functionality |
|---|---|
| pass(document_file) returns: document ID (guid), status code | The document is uploaded to the system manager repository. The document is given an ID, and the user is informed of the status code of the result (OK/error description). |
| process_pipeline(document_ID) returns: status code | The complete document processing workflow is executed. As a result, a Markdown or JSON file is stored in the repository with the same ID as the input document. The status code is returned to the caller. |
| process(document_ID, document_type) returns: status code | The processing workflow dedicated to the selected document type is executed. The true type of document identified by the passed ID is not checked. As a result, a Markdown or JSON file is stored in the repository with the same ID as the input document. The status code is returned to the caller. |
| classify(document_ID) returns: document type, stats code | The classification part of the workflow is executed. The classification result is returned to the caller along with the status code. |
| get_result(document_ID) returns: Markdown/JSON result document, status code | The content of the Markdown/JSON file (the result of document processing) for the given document ID is returned to the caller. |
| delete_document(document_ID) returns status code | All stored in files tied to the given document ID are removed permanently from the repository. |
| Model Name | Accuracy | Precision | Recall | F1 | Comp. Time [s] |
|---|---|---|---|---|---|
| cogito:70b | 0.973 | 0.847 | 0.834 | 0.839 | 2468.40 ± 1.66 |
| deepseek-r1:70b | 0.940 | 0.829 | 0.806 | 0.812 | 2481.70 ± 1.14 |
| devstral:24b-small | 0.940 | 0.832 | 0.806 | 0.815 | 477.28 ± 9.93 |
| gemma3:27b | 0.947 | 0.960 | 0.947 | 0.946 | 657.96 ± 1.14 |
| granite4:small-h | 0.693 | 0.654 | 0.594 | 0.588 | 374.03 ± 0.25 |
| llama3.1:70b | 0.953 | 0.828 | 0.817 | 0.819 | 2405.30 ± 7.33 |
| llama3.1:8b | 0.800 | 0.715 | 0.800 | 0.746 | 262.98 ± 0.16 |
| llama3.3:70b | 0.907 | 0.808 | 0.777 | 0.775 | 2249.39 ± 3.94 |
| magistral:24b | 0.967 | 0.841 | 0.829 | 0.833 | 436.87 ± 1.59 |
| mistral-small3.1:24b-instruct | 0.843 | 0.793 | 0.723 | 0.702 | 690.21 ± 0.44 |
| qwen2.5:72b | 0.853 | 0.792 | 0.731 | 0.703 | 3141.07 ± 13.83 |
| qwen3:32b | 0.927 | 0.829 | 0.794 | 0.803 | 585.43 ± 1.18 |
| Model Name | Accuracy | Precision | Recall | F1 | Comp. Time [s] |
|---|---|---|---|---|---|
| cogito:70b | 0.943 | 0.946 | 0.943 | 0.941 | 2859.80 ± 1.99 |
| deepseek-r1:70b | 0.846 | 0.839 | 0.846 | 0.824 | 2895.32 ± 1.13 |
| devstral:24b-small | 0.877 | 0.875 | 0.877 | 0.868 | 546.82 ± 6.72 |
| gemma3:27b | 0.843 | 0.873 | 0.843 | 0.815 | 766.61 ± 1.23 |
| granite4:small-h | 0.686 | 0.664 | 0.686 | 0.629 | 436.37 ± 0.27 |
| llama3.1:70b | 0.880 | 0.906 | 0.880 | 0.872 | 2816.19 ± 7.91 |
| llama3.1:8b | 0.731 | 0.705 | 0.731 | 0.677 | 306.81 ± 0.17 |
| llama3.3:70b | 0.840 | 0.878 | 0.840 | 0.827 | 2626.29 ± 4.06 |
| magistral:24b | 0.894 | 0.897 | 0.894 | 0.883 | 509.68 ± 1.71 |
| mistral-small3.1:24b-instruct | 0.780 | 0.844 | 0.780 | 0.744 | 806.24 ± 0.51 |
| qwen2.5:72b | 0.794 | 0.870 | 0.794 | 0.757 | 3684.58 ± 12.93 |
| qwen3:32b | 0.917 | 0.928 | 0.917 | 0.913 | 683.00 ± 1.27 |
| Classifier | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|
| SVM (Linear) | 0.867 | 0.880 | 0.867 | 0.865 |
| SVM (RBF) | 0.856 | 0.866 | 0.856 | 0.855 |
| Random Forest | 0.867 | 0.868 | 0.867 | 0.864 |
| Classifier | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|
| SVM (Linear) | 0.914 | 0.924 | 0.914 | 0.916 |
| SVM (RBF) | 0.886 | 0.900 | 0.886 | 0.888 |
| Random Forest | 0.895 | 0.902 | 0.895 | 0.895 |
| Research Reference | Accuracy | Method Used |
|---|---|---|
| Vajjala et al. [59] | 89.0% | Supervised Fine-Tuning (BERT/RoBERTa) |
| Zhang et al. [55] | 97.6% | RGPT-7 (Ensemble + Boosting framework using fine-tuned LLaMA-2-7B) |
| Xia et al. [63] | 98.21% | GPT-4V, proprietary multimodal LLM, Zero-shot |
| Serbanescu et al. [49] | 99.24% | MobileNetV2 (Pre-trained with data augmentation, Supervised) |
| Park et al. [64] | 95.69% | Longformer (Sparse-Attention Transformer, Supervised) |
| Van Landeghem et al. [62] | 94.45% | DiT-Base (Aggregated predictions from first/second/last pages) |
| Ours | 97.3% | Agentic Workflow/Cogito-70B (Zero-shot Open-Weight LLM) |
| Comparison Criteria | On-Prem Agentic LLM (Proposed) | Proprietary Cloud LLMs (e.g., GPT-4V [52]) | Conventional Approach (Supervised ML/CNN [53]) |
|---|---|---|---|
| Data Privacy & Security | High (Data never leaves on-premise infrastructure) | Low (Data processed via external API) | High (Local inference; no external data transfer) |
| Adaptability & Flexibility | High (Adaptable via prompt engineering) | High (Adaptable via prompt engineering) | Low (Requires retraining or new templates for new document types) |
| Training Data Requirement | None/Minimal (Relies on pre-trained reasoning and context) | None (Pre-trained) | High (Requires extensive annotated datasets for high accuracy) |
| Complex Logic & Reasoning | Medium (Agentic graph enables multi-step decision making & routing) | Medium/High (Dependent prompting strategy) | Low/None (Limited to pattern recognition; no semantic reasoning) |
| Operational Efficiency | Balanced (Moderate to high hardware cost) | Variable (High operational costs at scale) | High (Very fast inference; low compute cost; best for static layouts) |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Iwaszenko, S.; Czaja, S.; Kozłowski, A. NLP System for Automation of Document Workflow in a Research and Development Organization—A Case Study. Appl. Sci. 2026, 16, 4562. https://doi.org/10.3390/app16094562
Iwaszenko S, Czaja S, Kozłowski A. NLP System for Automation of Document Workflow in a Research and Development Organization—A Case Study. Applied Sciences. 2026; 16(9):4562. https://doi.org/10.3390/app16094562
Chicago/Turabian StyleIwaszenko, Sebastian, Sławomir Czaja, and Artur Kozłowski. 2026. "NLP System for Automation of Document Workflow in a Research and Development Organization—A Case Study" Applied Sciences 16, no. 9: 4562. https://doi.org/10.3390/app16094562
APA StyleIwaszenko, S., Czaja, S., & Kozłowski, A. (2026). NLP System for Automation of Document Workflow in a Research and Development Organization—A Case Study. Applied Sciences, 16(9), 4562. https://doi.org/10.3390/app16094562

