Spaces:
Running
Running
File size: 334 Bytes
d2a63cc e4316f1 d2a63cc 283e483 0b9d8c7 |
1 2 3 4 5 6 7 8 9 10 11 |
from typing import Any, Dict, List
from graphgen.bases.base_reader import BaseReader
class TXTReader(BaseReader):
def read(self, file_path: str) -> List[Dict[str, Any]]:
with open(file_path, "r", encoding="utf-8") as f:
docs = [{"type": "text", self.text_column: f.read()}]
return self.filter(docs)
|