Spaces:
Build error
Build error
Update backend.py
Browse files- backend.py +16 -0
backend.py
CHANGED
|
@@ -8,3 +8,19 @@ from langchain.prompts import PromptTemplate
|
|
| 8 |
|
| 9 |
os.environ["GOOGLE_API_KEY"]="AIzaSyC8W6-q0Db2200MDE3LpsVZPrkzXZUUuW0"
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
os.environ["GOOGLE_API_KEY"]="AIzaSyC8W6-q0Db2200MDE3LpsVZPrkzXZUUuW0"
|
| 10 |
|
| 11 |
+
class InvoicePipeline:
|
| 12 |
+
#This fuction will help in extracting and run the code, and will produce dataframe for us
|
| 13 |
+
def run(self) -> pd.DataFrame:
|
| 14 |
+
df=pd.DataFrame(
|
| 15 |
+
"Invoice ID": pd.Series(dtype = "int"),
|
| 16 |
+
"DESCRIPTION": pd.Series(dtype = "str"),
|
| 17 |
+
"Issue Date": pd.series(dtype = "str"),
|
| 18 |
+
"Unit Price": pd.Series(dtype = "str"),
|
| 19 |
+
"Amount": pd.Series(dtype = "int"),
|
| 20 |
+
"Bill For":pd.Series(dtype="str"),
|
| 21 |
+
"From": pd.Series(dtype = "str"),
|
| 22 |
+
"Terms": pd.Series(dtype= "str")
|
| 23 |
+
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
|