while True:
query = input("Enter your question (or 'exit' to quit): ")
if query.lower() == 'exit':
break
result = retrieval_chain.invoke(query)
answer = result['result']
print(f"Query: {query}nAnswer: {answer}n")
This is the response :
Enter your question (or ‘exit’ to quit): probability
Query: probability
Answer: Use the following pieces of context to answer the question at the end. If you don’t know the answer, just say that you don’t know, don’t try to make up an answer.
2
Portability and Statistics
for Data Science
2.2 PROBABILITY
Probability is a possible measure of occurrence of a specific event amongst a
group of events, if the occurrence of the events is observed for a large number
of trials. For example, possibility of getting 1, while rolling a fair die is 1/6. You
may please note that you need to observe this event by repeatedly rolling a die
for a large number of trials to arrive at this probability or you may determine the
probability subjectively by finding the ratio of this outcome and the total number
of possible outcomes, which may be equally likely. Thus, the probability of an
event (E) can be computed using the following formula:
????(????)= !”#$%& () (“+(#%, -. /% ,% () 011 2(,,-$1% (“+(#%, /0 &%,”1* -. %3%.* 4
!”#$%& (“+(#%, -. /% ,% () 011 2(,,-$1% (“+(#%, (1)
• Compute the conditional probability of events;
• Use Bayes theorem in problem solving
• Explain the concept of random variable;
• Explain the characteristics of binomial and normal distribution;
• Describes the sampling distribution and central limit theorem;
• State the statistical hypothesis ; and
• Perform significance testing.
6
Portability and Statistics
for Data Science
X Frequency Probability P(X)
0 1 1/8
1 3 3/8
2 3 3/8
3 1 1/8
Total 8 Sum of all P(X) = 1
Figure 3: The Frequency and Probability of Random Variable X
The Random variables are of two kinds:
• Discrete Random Variable
• Continuous Random Variable
Discrete random variables, as the name suggests, can take discrete values only.
Figure 3 shows a discrete random variable X. A discrete random variable, as a
Question: probability
Helpful Answer: The provided text contains information regarding probability, its calculation, and different concepts related to it. However, the specific probability value or calculation is not explicitly stated in the given text.
Enter your question (or ‘exit’ to quit): exit
I only want to print out helpful answer when user inputs a question and store rest as the context for future operations
i tried stripping helpful answer from answer which stored result but nothing happens and i am not able to print anything i tried changing my prompyt template that is not even affecting the response
Kaurcs2001 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.