hosseinhimself commited on
Commit
c362ce2
1 Parent(s): 912ab00

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -8
README.md CHANGED
@@ -59,17 +59,15 @@ model = AutoModelForQuestionAnswering.from_pretrained(model)
59
  qa_pipeline = pipeline("question-answering", model=model, tokenizer=tokenizer)
60
 
61
  # Example usage
62
- context = "CONTEXT"
63
 
64
- question = "QUESTION"
65
 
66
- # Modify the pipeline to return more answers
67
- results = qa_pipeline(question=question, context=context, top_k=5) # top_k specifies the number of answers
68
-
69
- # Display the answers
70
- for idx, result in enumerate(results):
71
- print(f"Answer {idx+1}: {result['answer']}")
72
 
 
 
73
  ```
74
 
75
  ## Datasets
 
59
  qa_pipeline = pipeline("question-answering", model=model, tokenizer=tokenizer)
60
 
61
  # Example usage
62
+ context = "شرکت فولاد مبارکه در سال 1371 تأسیس شد."
63
 
64
+ question = "چه زمانی شرکت فولاد مبارکه تأسیس شد؟"
65
 
66
+ # Modify the pipeline to return answer
67
+ results = qa_pipeline(question=question, context=context)
 
 
 
 
68
 
69
+ # Display the answer
70
+ print(results['answer'])
71
  ```
72
 
73
  ## Datasets