Spaces:
Running
Running
Upload 9 files
Browse files
rerank.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
# reranks the top articles from a given csv file
|
2 |
-
from
|
3 |
-
from
|
4 |
-
from langchain_community.document_loaders import CSVLoader
|
|
|
5 |
from langchain_community.vectorstores import DocArrayInMemorySearch
|
6 |
from langchain.indexes import VectorstoreIndexCreator
|
7 |
from sentence_transformers import CrossEncoder, util
|
8 |
-
from
|
9 |
import pandas as pd
|
10 |
import time
|
11 |
|
|
|
1 |
# reranks the top articles from a given csv file
|
2 |
+
from langchain_openai import ChatOpenAI
|
3 |
+
from langchain_core.chains import RetrievalQA
|
4 |
+
from langchain_community.document_loaders.csv_loader import CSVLoader
|
5 |
+
|
6 |
from langchain_community.vectorstores import DocArrayInMemorySearch
|
7 |
from langchain.indexes import VectorstoreIndexCreator
|
8 |
from sentence_transformers import CrossEncoder, util
|
9 |
+
from langchain.chains.qa_with_sources.retrieval import RetrievalQAWithSourcesChain
|
10 |
import pandas as pd
|
11 |
import time
|
12 |
|