bhaviktheslider commited on
Commit
2442ac6
·
verified ·
1 Parent(s): 2676b9e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -131
README.md CHANGED
@@ -38,9 +38,8 @@ This repository provides a fine-tuned Qwen2 model optimized for transforming uns
38
  - [Quick Start](#quick-start)
39
  - [Using Unsloth for Fast Inference](#using-unsloth-for-fast-inference)
40
  - [Using Transformers for Inference](#using-transformers-for-inference)
41
- - [Prompt & Code Examples](#prompt--code-examples)
42
- - [Example 1: Basic Alpaca Prompt Template](#example-1-basic-alpaca-prompt-template)
43
- - [Example 2: Advanced Data Extraction with LangChain](#example-2-advanced-data-extraction-with-langchain)
44
  - [Sample Responses & Chain-of-Thought Explanations](#sample-responses--chain-of-thought-explanations)
45
  - [Contributing](#contributing)
46
  - [License](#license)
@@ -168,135 +167,9 @@ print(tokenizer.decode(output_ids[0], skip_special_tokens=True))
168
 
169
  ---
170
 
171
- ## Prompt & Code Examples
172
 
173
- To guide the model in mapping unstructured text to a JSON schema, you can structure your prompt as follows.
174
-
175
- ### Example 1: Basic Alpaca Prompt Template
176
-
177
- #### Code
178
-
179
- ```python
180
- # Define the Alpaca prompt template
181
- ALPACA_PROMPT = """
182
- Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
183
- ### Instruction:
184
- {}
185
- ### Response:
186
- {}
187
- """
188
-
189
- # Sample text input describing a Quality Assurance Manual
190
- TEXT = """
191
- The Quality Assurance Manual for Manufacturing Process serves as a comprehensive guide to ensuring the quality of manufactured products and services. This manual encompasses all avenues of the QA process, including methodologies for testing, established standards, and documentation practices.
192
-
193
- This document introduces the fundamental principles of quality assurance, emphasizing its role in achieving customer satisfaction across different manufacturing domains. According to the key metrics outlined in the Key Metrics for QA table, the defect rate stands at 0.5%, while the yield rate is 98%. These metrics underscore the importance of strict quality control measures to achieve high levels of product reliability.
194
-
195
- ---
196
-
197
- Introduction to Quality Assurance
198
- This section delves into the core principles of quality assurance, setting the foundation for the detailed methodologies that follow. Quality Assurance (QA) is a critical process that ensures that products and services fully meet customer expectations and industry standards.
199
-
200
- QA in Manufacturing Processes
201
- Manufacturing processes require strict adherence to QA procedures to ensure product reliability and safety. In this subsection, we explore QA in specific manufacturing processes, covering essential aspects such as process controls and raw material inspection. The QA Checklist for Manufacturing identifies critical processes that must be controlled, such as Process Controls (checked), but also highlights areas that need further attention, such as Raw Material Inspection (not check).
202
-
203
- [QA Checklist for Manufacturing]
204
- | Process Controls | True | Value: Yes |
205
- | Raw Material Inspection | False | Value: No |
206
-
207
- Confirming QA procedures are followed is essential to maintaining quality standards in manufacturing. This checklist includes two items: Defects Identified and Corrected and Regular Audits Conducted. For Defects Identified and Corrected, the item is checked, indicating that the relevant procedures are in place. However, Regular Audits Conducted is not checked, suggesting a potential gap in this area.
208
-
209
- Quality Assurance Standards
210
- ISO 9001 is a well-known standard for quality management systems, which forms the backbone of many manufacturing QA processes. This subsection discusses the adoption and benefits of ISO 9001. The QA Standards Comparison table provides a side-by-side view of two standards: ISO 9001 and ASQ Certified Quality Manager. ISO 9001 is checked, indicating full compliance, while ASQ Certified Quality Manager is not checked, indicating a need for further certification.
211
-
212
- These standards, coupled with rigorous testing methodologies and comprehensive documentation, form the pillars of our quality assurance framework. Ensuring that all manufacturing processes comply with these standards not only improves product quality but also enhances customer trust and satisfaction. Achieving and maintaining such standards requires ongoing effort and commitment from all involved parties.
213
- """
214
-
215
- # JSON schema defining the expected structure of the output
216
- SCHEMA = """
217
- {
218
- "type": "object",
219
- "properties": {
220
- "id": {
221
- "type": "string",
222
- "description": "Dot-separated integers representing the unique identifier of each element in the hierarchy."
223
- },
224
- "title": {
225
- "type": "string",
226
- "description": "Descriptive title for the section or document."
227
- },
228
- "level": {
229
- "type": "integer",
230
- "description": "Hierarchy level starting from 0 (root)."
231
- },
232
- "level_type": {
233
- "type": "string",
234
- "enum": ["ROOT", "SECTION", "SUBSECTION", "DETAIL_N"],
235
- "description": "Type of hierarchy level."
236
- },
237
- "component": {
238
- "type": "array",
239
- "items": {
240
- "type": "object",
241
- "properties": {
242
- "idc": {
243
- "type": "integer",
244
- "description": "Component ID within the element."
245
- },
246
- "component_type": {
247
- "type": "string",
248
- "enum": ["PARAGRAPH", "TABLE", "CALCULATION", "CHECKBOX"],
249
- "description": "Type of component (e.g., paragraph, table)."
250
- },
251
- "metadata": {
252
- "type": "string",
253
- "pattern": "<title>.+</title>|<note>.+</note>|<overview>.+</overview>",
254
- "description": "Metadata such as title, note, or overview."
255
- },
256
- "properties": {
257
- "type": "object",
258
- "properties": {
259
- "variables": {
260
- "type": "array",
261
- "items": {
262
- "type": "object",
263
- "properties": {
264
- "idx": {"type": "string"},
265
- "name": {"type": "string"},
266
- "value": {},
267
- "unit": {"type": ["null", "string"]},
268
- "metrics": {"type": "boolean"},
269
- "formula": {"type": "boolean"}
270
- },
271
- "required": ["idx", "name", "value"]
272
- }
273
- },
274
- "content": {
275
- "type": ["array"],
276
- "items": {"type": "string"}
277
- }
278
- }
279
- }
280
- },
281
- "required": ["idc", "component_type", "metadata", "properties"]
282
- }
283
- },
284
- "children": {
285
- "type": "array",
286
- "items": {}
287
- }
288
- },
289
- "required": ["id", "title", "level", "level_type", "component", "children"]
290
- }
291
- """
292
-
293
- # Now you would use your chosen inference method (e.g., via Unsloth or Transformers)
294
- # to feed the prompt (ALPACA_PROMPT, TEXT, and SCHEMA) into the model.
295
- ```
296
-
297
- ---
298
-
299
- ### Example 2: Advanced Data Extraction with LangChain
300
 
301
  #### Code
302
 
 
38
  - [Quick Start](#quick-start)
39
  - [Using Unsloth for Fast Inference](#using-unsloth-for-fast-inference)
40
  - [Using Transformers for Inference](#using-transformers-for-inference)
41
+ - [Prompt & Code Example - How to run](#prompt--code-example)
42
+ - [Example: Advanced Data Extraction with LangChain](#example-advanced-data-extraction-with-langchain)
 
43
  - [Sample Responses & Chain-of-Thought Explanations](#sample-responses--chain-of-thought-explanations)
44
  - [Contributing](#contributing)
45
  - [License](#license)
 
167
 
168
  ---
169
 
170
+ ## Prompt & Code Example
171
 
172
+ ### Example: Advanced Data Extraction with LangChain
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
 
174
  #### Code
175