You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* added notebook that showcases copilot application suing NIM, embedding model and FAISS VDB. All these tools are integrated using Langchain plugins. The notebook also has a Gradio-based UI to interact with the application
* added images for the notebook and minor tweaks in the notebook
* typo correction
* Update langchain_copilot_with_NIM_HF_FAISS_deployed_locally.ipynb
* Update langchain_copilot_with_NIM_HF_FAISS_deployed_locally.ipynb
corrected typo
* file management: moved notebooks under llm_video_series
* changed one dependencies
* added image files for notebook
* removed images not used
* removed auto generated folders and README.md
* added RAGAS evaluation. (1) Added changes to save top-n context pulled by retriever that is needed for downstream RAGAS evaluation. (2) modified UI to pick which evalutaion to use from drop down
* Added LLM as a judge to the evaluation
* added LLM as a judge, argument to read only pdf files from the folder, RAGAS evaluation
---------
Co-authored-by: Jay Rodge <[email protected]>
context="Here are the relationships from the knowledge graph: "+"\n".join(all_triplets)
158
+
context_return= []
159
+
ifall_triplets:
160
+
context_return= [tripfortripinall_triplets]
161
+
else:
162
+
context_return= ["no relationship found"]
144
163
except:
145
164
context="No graph triples were available to extract from the knowledge graph. Always provide a disclaimer if you know the answer to the user's question, since it is not grounded in the knowledge you are provided from the graph."
context+="\n\nHere are the relationships from the knowledge graph: "+"\n".join(all_triplets)
188
+
ifall_triplets:
189
+
fortripinall_triplets:
190
+
context_return.append(trip)
165
191
exceptExceptionase:
166
192
context="No graph triples were available to extract from the knowledge graph. Always provide a disclaimer if you know the answer to the user's question, since it is not grounded in the knowledge you are provided from the graph."
nvapi_key=getpass.getpass("Enter your NVIDIA API key: ")
@@ -68,7 +69,7 @@ def extract_triples(text, llm):
68
69
69
70
Remember to conduct entity disambiguation, consolidating different phrases or acronyms that refer to the same entity (for instance, "MIT" and "Massachusetts Institute of Technology" should be unified as "MIT"). Simplify each entity of the triplet to be less than four words. However, always make sure it is a sensible entity name and not a single letter or NAN value.
70
71
71
-
From this text, your output Must be in python lis tof tuple with each tuple made up of ['h', 'type', 'r', 'o', 'type'], each element of the tuple is the string, where the relationship 'r' must be in the given relation verbs set above. Only output the list. As an Example, consider the following news excerpt:
72
+
From this text, your output Must be in python list of tuple with each tuple made up of ['h', 'type', 'r', 'o', 'type'], each element of the tuple is the string, where the relationship 'r' must be in the given relation verbs set above. Only output the list. As an Example, consider the following news excerpt:
72
73
Input :'Apple Inc. is set to introduce the new iPhone 14 in the technology sector this month. The product's release is likely to positively impact Apple's stock value.'
You will be given a user_question and system_answer couple.
88
+
Your task is to provide a 'total rating' scoring how well the system_answer answers the user concerns expressed in the user_question.
89
+
Give your answer on a scale of 1 to 4, where 1 means that the system_answer is not helpful at all, and 4 means that the system_answer completely and helpfully addresses the user_question.
90
+
91
+
Here is the scale you should use to build your answer:
92
+
1: The system_answer is terrible: completely irrelevant to the question asked, or very partial
93
+
2: The system_answer is mostly not helpful: misses some key aspects of the question
94
+
3: The system_answer is mostly helpful: provides support, but still could be improved
95
+
4: The system_answer is excellent: relevant, direct, detailed, and addresses all the concerns raised in the question
96
+
97
+
Provide your feedback as follows:
98
+
99
+
Feedback:::
100
+
Evaluation: (your rationale for the rating, as a text)
101
+
Total rating: (your rating, as a number between 1 and 4)
102
+
103
+
You MUST provide values for 'Evaluation:' and 'Total rating:' in your answer.
104
+
105
+
Now here are the question and answer.
106
+
107
+
Question: {question}
108
+
Answer: {answer}
109
+
110
+
Provide your feedback. If you give a correct rating, I'll tip you $200.
[("system", """You are a synthetic data generation model responsible for creating high quality question and answer pairs from text content provided to you. Given the paragraph as an input, create one high quality and highly complex question answer pair. The question should require a large portion of the context and multi-step advanced reasoning to answer. Make sure it is something a human may ask while reading this document. The answer should be highly detailed and comprehensive. Your output should be in a json format of one question answer pair. Restrict the question to the context information provided. Do not print anything else. The output MUST be JSON parseable."""), ("user", "{input}")])
0 commit comments