Added documentation (#219)

This commit is contained in:
aaishikdutta
2023-07-11 08:31:42 +05:30
committed by GitHub
parent eda28cc491
commit 6936d6983d
15 changed files with 21 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ from langchain.document_loaders import Docx2txtLoader
class DocxFileLoader:
def load_data(self, url):
''' Load data from a .docx file. '''
loader = Docx2txtLoader(url)
output = []
data = loader.load()

View File

@@ -1,6 +1,7 @@
class LocalQnaPairLoader:
def load_data(self, content):
''' Load data from a local QnA pair. '''
question, answer = content
content = f"Q: {question}\nA: {answer}"
meta_data = {

View File

@@ -1,6 +1,7 @@
class LocalTextLoader:
def load_data(self, content):
''' Load data from a local text file. '''
meta_data = {
"url": "local",
}

View File

@@ -6,6 +6,7 @@ from embedchain.utils import clean_string
class PdfFileLoader:
def load_data(self, url):
''' Load data from a PDF file. '''
loader = PyPDFLoader(url)
output = []
pages = loader.load_and_split()

View File

@@ -8,6 +8,7 @@ from embedchain.utils import clean_string
class WebPageLoader:
def load_data(self, url):
''' Load data from a web page. '''
response = requests.get(url)
data = response.content
soup = BeautifulSoup(data, 'html.parser')

View File

@@ -6,6 +6,7 @@ from embedchain.utils import clean_string
class YoutubeVideoLoader:
def load_data(self, url):
''' Load data from a Youtube video. '''
loader = YoutubeLoader.from_youtube_url(url, add_video_info=True)
doc = loader.load()
output = []