Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -2,7 +2,7 @@ from fastapi import FastAPI
|
|
| 2 |
import uvicorn
|
| 3 |
|
| 4 |
|
| 5 |
-
|
| 6 |
import pandas as pd
|
| 7 |
import numpy as np
|
| 8 |
import requests
|
|
@@ -24,6 +24,13 @@ app = FastAPI()
|
|
| 24 |
def root():
|
| 25 |
return {"API": "AdressScrap"}
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
def jaccard_similarity(string1, string2,n = 2, normalize=True):
|
| 28 |
try:
|
| 29 |
if normalize:
|
|
@@ -99,7 +106,7 @@ def google_address(address):
|
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
-
@app.get('/
|
| 103 |
async def predict(address: str):
|
| 104 |
try:
|
| 105 |
results= google_address(addresses)
|
|
|
|
| 2 |
import uvicorn
|
| 3 |
|
| 4 |
|
| 5 |
+
|
| 6 |
import pandas as pd
|
| 7 |
import numpy as np
|
| 8 |
import requests
|
|
|
|
| 24 |
def root():
|
| 25 |
return {"API": "AdressScrap"}
|
| 26 |
|
| 27 |
+
def normalize_string(string):
|
| 28 |
+
normalized_string = string.lower()
|
| 29 |
+
normalized_string = re.sub(r'[^\w\s]', '', normalized_string)
|
| 30 |
+
|
| 31 |
+
return normalized_string
|
| 32 |
+
|
| 33 |
+
|
| 34 |
def jaccard_similarity(string1, string2,n = 2, normalize=True):
|
| 35 |
try:
|
| 36 |
if normalize:
|
|
|
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
+
@app.get('/AddressScrap)
|
| 110 |
async def predict(address: str):
|
| 111 |
try:
|
| 112 |
results= google_address(addresses)
|