Update app2.py
Browse files
app2.py
CHANGED
@@ -1252,6 +1252,161 @@ def get_trend_description(df):
|
|
1252 |
else:
|
1253 |
return "The number of cases has remained relatively stable over the five-year period."
|
1254 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1255 |
class LegalDataRetriever:
|
1256 |
def __init__(self):
|
1257 |
self.session = requests.Session()
|
@@ -1607,7 +1762,7 @@ with st.sidebar:
|
|
1607 |
|
1608 |
feature = st.selectbox(
|
1609 |
"Select a feature",
|
1610 |
-
["Legal Chatbot", "Document Analysis", "Case Precedent Finder", "Legal Cost Estimator", "Contract Analysis", "Case Trend Visualizer", "Case Information Retrieval", "Automated Legal Brief Generation"]
|
1611 |
)
|
1612 |
if feature == "Legal Chatbot":
|
1613 |
st.subheader("Legal Chatbot")
|
@@ -1768,7 +1923,9 @@ elif feature == "Case Information Retrieval":
|
|
1768 |
|
1769 |
elif feature == "Automated Legal Brief Generation":
|
1770 |
automated_legal_brief_generation_ui()
|
1771 |
-
|
|
|
|
|
1772 |
st.markdown("---")
|
1773 |
st.markdown(
|
1774 |
"""
|
|
|
1252 |
else:
|
1253 |
return "The number of cases has remained relatively stable over the five-year period."
|
1254 |
|
1255 |
+
PRACTICE_AREAS = [
|
1256 |
+
"Personal Injury", "Medical Malpractice", "Criminal Law", "DUI & DWI", "Family Law",
|
1257 |
+
"Divorce", "Bankruptcy", "Business Law", "Consumer Law", "Employment Law",
|
1258 |
+
"Estate Planning", "Foreclosure Defense", "Immigration Law", "Intellectual Property",
|
1259 |
+
"Nursing Home Abuse", "Probate", "Products Liability", "Real Estate Law", "Tax Law",
|
1260 |
+
"Traffic Tickets", "Workers' Compensation", "Agricultural Law", "Animal & Dog Law",
|
1261 |
+
"Antitrust Law", "Appeals & Appellate", "Arbitration & Mediation", "Asbestos & Mesothelioma",
|
1262 |
+
"Cannabis & Marijuana Law", "Civil Rights", "Collections", "Communications & Internet Law",
|
1263 |
+
"Construction Law", "Domestic Violence", "Education Law", "Elder Law",
|
1264 |
+
"Energy, Oil & Gas Law", "Entertainment & Sports Law", "Environmental Law",
|
1265 |
+
"Gov & Administrative Law", "Health Care Law", "Insurance Claims", "Insurance Defense",
|
1266 |
+
"International Law", "Juvenile Law", "Landlord Tenant", "Legal Malpractice",
|
1267 |
+
"Maritime Law", "Military Law", "Municipal Law", "Native American Law", "Patents",
|
1268 |
+
"Securities Law", "Social Security Disability", "Stockbroker & Investment Fraud",
|
1269 |
+
"Trademarks", "White Collar Crime"
|
1270 |
+
]
|
1271 |
+
|
1272 |
+
STATES = [
|
1273 |
+
"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut",
|
1274 |
+
"Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa",
|
1275 |
+
"Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan",
|
1276 |
+
"Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire",
|
1277 |
+
"New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio",
|
1278 |
+
"Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota",
|
1279 |
+
"Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia",
|
1280 |
+
"Wisconsin", "Wyoming", "Washington, DC"
|
1281 |
+
]
|
1282 |
+
|
1283 |
+
CITIES_BY_STATE = {
|
1284 |
+
"Alabama": ["Birmingham", "Montgomery", "Mobile", "Huntsville", "Tuscaloosa", "Hoover", "Dothan", "Auburn", "Decatur", "Madison", "Florence", "Gadsden", "Vestavia Hills", "Prattville", "Phenix City", "Alabaster", "Bessemer", "Prichard", "Opelika", "Enterprise"],
|
1285 |
+
"Alaska": ["Anchorage", "Fairbanks", "Juneau", "Sitka", "Ketchikan", "Wasilla", "Kenai", "Kodiak", "Bethel", "Palmer", "Homer", "Unalaska", "Barrow", "Soldotna", "Valdez", "Nome", "Kotzebue", "Seward", "Wrangell", "Dillingham"],
|
1286 |
+
"Arizona": ["Phoenix", "Tucson", "Mesa", "Chandler", "Glendale", "Scottsdale", "Gilbert", "Tempe", "Peoria", "Surprise", "Yuma", "Avondale", "Goodyear", "Flagstaff", "Buckeye", "Lake Havasu City", "Casa Grande", "Sierra Vista", "Maricopa", "Oro Valley"],
|
1287 |
+
"Arkansas": ["Little Rock", "Fort Smith", "Fayetteville", "Springdale", "Jonesboro", "North Little Rock", "Conway", "Rogers", "Pine Bluff", "Bentonville", "Hot Springs", "Benton", "Texarkana", "Sherwood", "Jacksonville", "Russellville", "Bella Vista", "West Memphis", "Paragould", "Cabot"],
|
1288 |
+
"California": ["Los Angeles", "San Diego", "San Jose", "San Francisco", "Fresno", "Sacramento", "Long Beach", "Oakland", "Bakersfield", "Anaheim", "Santa Ana", "Riverside", "Stockton", "Irvine", "Chula Vista", "Fremont", "San Bernardino", "Modesto", "Fontana", "Oxnard"],
|
1289 |
+
"Colorado": ["Denver", "Colorado Springs", "Aurora", "Fort Collins", "Lakewood", "Thornton", "Arvada", "Westminster", "Pueblo", "Centennial", "Boulder", "Greeley", "Longmont", "Loveland", "Broomfield", "Grand Junction", "Castle Rock", "Commerce City", "Parker", "Northglenn"],
|
1290 |
+
"Connecticut": ["Bridgeport", "New Haven", "Stamford", "Hartford", "Waterbury", "Norwalk", "Danbury", "New Britain", "West Hartford", "Greenwich", "Hamden", "Meriden", "Bristol", "Manchester", "West Haven", "Milford", "Stratford", "East Hartford", "Middletown", "Wallingford"],
|
1291 |
+
"Delaware": ["Wilmington", "Dover", "Newark", "Middletown", "Smyrna", "Milford", "Seaford", "Georgetown", "Elsmere", "New Castle", "Millsboro", "Laurel", "Harrington", "Camden", "Clayton", "Lewes", "Milton", "Selbyville", "Rehoboth Beach", "Delaware City"],
|
1292 |
+
"Florida": ["Jacksonville", "Miami", "Tampa", "Orlando", "St. Petersburg", "Hialeah", "Tallahassee", "Fort Lauderdale", "Port St. Lucie", "Cape Coral", "Pembroke Pines", "Hollywood", "Miramar", "Gainesville", "Coral Springs", "Miami Gardens", "Clearwater", "Palm Bay", "Pompano Beach", "West Palm Beach"],
|
1293 |
+
"Georgia": ["Atlanta", "Augusta", "Columbus", "Macon", "Savannah", "Athens", "Sandy Springs", "Roswell", "Johns Creek", "Albany", "Warner Robins", "Alpharetta", "Marietta", "Valdosta", "Smyrna", "Dunwoody", "Rome", "East Point", "Milton", "Gainesville"],
|
1294 |
+
"Hawaii": ["Honolulu", "East Honolulu", "Pearl City", "Hilo", "Kailua", "Waipahu", "Kaneohe", "Mililani Town", "Kahului", "Ewa Gentry", "Kihei", "Makakilo", "Wahiawa", "Schofield Barracks", "Wailuku", "Kapolei", "Ewa Beach", "Royal Kunia", "Halawa", "Waimalu"],
|
1295 |
+
"Idaho": ["Boise", "Meridian", "Nampa", "Idaho Falls", "Pocatello", "Caldwell", "Coeur d'Alene", "Twin Falls", "Lewiston", "Post Falls", "Rexburg", "Eagle", "Moscow", "Mountain Home", "Ammon", "Kuna", "Hayden", "Chubbuck", "Garden City", "Blackfoot"],
|
1296 |
+
"Illinois": ["Chicago", "Aurora", "Joliet", "Naperville", "Rockford", "Elgin", "Springfield", "Peoria", "Champaign", "Waukegan", "Cicero", "Bloomington", "Arlington Heights", "Evanston", "Decatur", "Schaumburg", "Bolingbrook", "Palatine", "Skokie", "Des Plaines"],
|
1297 |
+
"Indiana": ["Indianapolis", "Fort Wayne", "Evansville", "South Bend", "Carmel", "Fishers", "Bloomington", "Hammond", "Gary", "Lafayette", "Muncie", "Terre Haute", "Kokomo", "Anderson", "Noblesville", "Greenwood", "Elkhart", "Mishawaka", "Lawrence", "Jeffersonville"],
|
1298 |
+
"Iowa": ["Des Moines", "Cedar Rapids", "Davenport", "Sioux City", "Iowa City", "Waterloo", "Ames", "West Des Moines", "Council Bluffs", "Dubuque", "Ankeny", "Urbandale", "Cedar Falls", "Marion", "Bettendorf", "Mason City", "Clinton", "Marshalltown", "Burlington", "Ottumwa"],
|
1299 |
+
"Kansas": ["Wichita", "Overland Park", "Kansas City", "Olathe", "Topeka", "Lawrence", "Shawnee", "Manhattan", "Lenexa", "Salina", "Hutchinson", "Leavenworth", "Leawood", "Dodge City", "Garden City", "Junction City", "Emporia", "Derby", "Prairie Village", "Hays"],
|
1300 |
+
"Kentucky": ["Louisville", "Lexington", "Bowling Green", "Owensboro", "Covington", "Richmond", "Georgetown", "Florence", "Hopkinsville", "Nicholasville", "Frankfort", "Henderson", "Jeffersontown", "Elizabethtown", "Independence", "Radcliff", "Ashland", "Madisonville", "Erlanger", "Winchester"],
|
1301 |
+
"Louisiana": ["New Orleans", "Baton Rouge", "Shreveport", "Lafayette", "Lake Charles", "Kenner", "Bossier City", "Monroe", "Alexandria", "New Iberia", "Houma", "Slidell", "Ruston", "Hammond", "Pineville", "Zachary", "Thibodaux", "Crowley", "Baker", "Minden"],
|
1302 |
+
"Maine": ["Portland", "Lewiston", "Bangor", "South Portland", "Auburn", "Biddeford", "Sanford", "Brunswick", "Augusta", "Scarborough", "Saco", "Westbrook", "Windham", "Gorham", "Waterville", "York", "Falmouth", "Kennebunk", "Orono", "Standish"],
|
1303 |
+
"Maryland": ["Baltimore", "Frederick", "Rockville", "Gaithersburg", "Bowie", "Hagerstown", "Annapolis", "College Park", "Salisbury", "Laurel", "Greenbelt", "Cumberland", "Westminster", "Hyattsville", "Takoma Park", "Easton", "Elkton", "Aberdeen", "Havre de Grace", "Cambridge"],
|
1304 |
+
"Massachusetts": ["Boston", "Worcester", "Springfield", "Lowell", "Cambridge", "New Bedford", "Brockton", "Quincy", "Lynn", "Fall River", "Newton", "Lawrence", "Somerville", "Framingham", "Haverhill", "Waltham", "Malden", "Brookline", "Plymouth", "Medford"],
|
1305 |
+
"Michigan": ["Detroit", "Grand Rapids", "Warren", "Sterling Heights", "Ann Arbor", "Lansing", "Flint", "Dearborn", "Livonia", "Troy", "Westland", "Farmington Hills", "Kalamazoo", "Wyoming", "Southfield", "Rochester Hills", "Taylor", "St. Clair Shores", "Pontiac", "Royal Oak"],
|
1306 |
+
"Minnesota": ["Minneapolis", "St. Paul", "Rochester", "Duluth", "Bloomington", "Brooklyn Park", "Plymouth", "St. Cloud", "Eagan", "Woodbury", "Maple Grove", "Eden Prairie", "Coon Rapids", "Burnsville", "Blaine", "Lakeville", "Minnetonka", "Apple Valley", "Edina", "St. Louis Park"],
|
1307 |
+
"Mississippi": ["Jackson", "Gulfport", "Southaven", "Hattiesburg", "Biloxi", "Meridian", "Tupelo", "Greenville", "Olive Branch", "Horn Lake", "Clinton", "Pearl", "Madison", "Starkville", "Oxford", "Columbus", "Vicksburg", "Pascagoula", "Brandon", "Ridgeland"],
|
1308 |
+
"Missouri": ["Kansas City", "St. Louis", "Springfield", "Columbia", "Independence", "Lee's Summit", "O'Fallon", "St. Joseph", "St. Charles", "St. Peters", "Blue Springs", "Florissant", "Joplin", "Chesterfield", "Jefferson City", "Cape Girardeau", "Wentzville", "Wildwood", "University City", "Ballwin"],
|
1309 |
+
"Montana": ["Billings", "Missoula", "Great Falls", "Bozeman", "Butte", "Helena", "Kalispell", "Havre", "Anaconda", "Miles City", "Belgrade", "Livingston", "Laurel", "Whitefish", "Lewistown", "Sidney", "Columbia Falls", "Polson", "Hamilton", "Glendive"],
|
1310 |
+
"Nebraska": ["Omaha", "Lincoln", "Bellevue", "Grand Island", "Kearney", "Fremont", "Hastings", "Norfolk", "North Platte", "Columbus", "Papillion", "La Vista", "Scottsbluff", "South Sioux City", "Beatrice", "Lexington", "Alliance", "Gering", "Blair", "York"],
|
1311 |
+
"Nevada": ["Las Vegas", "Henderson", "Reno", "North Las Vegas", "Sparks", "Carson City", "Fernley", "Elko", "Mesquite", "Boulder City", "Fallon", "Winnemucca", "West Wendover", "Ely", "Yerington", "Carlin", "Lovelock", "Wells", "Caliente", "Searchlight"],
|
1312 |
+
"New Hampshire": ["Manchester", "Nashua", "Concord", "Dover", "Rochester", "Keene", "Derry", "Portsmouth", "Laconia", "Lebanon", "Claremont", "Somersworth", "Londonderry", "Durham", "Hampton", "Milford", "Exeter", "Merrimack", "Salem", "Hudson"],
|
1313 |
+
"New Jersey": ["Newark", "Jersey City", "Paterson", "Elizabeth", "Trenton", "Clifton", "Camden", "Passaic", "Union City", "Bayonne", "East Orange", "Vineland", "New Brunswick", "Hoboken", "Perth Amboy", "West New York", "Plainfield", "Hackensack", "Sayreville", "North Bergen"],
|
1314 |
+
"New Mexico": ["Albuquerque", "Las Cruces", "Rio Rancho", "Santa Fe", "Roswell", "Farmington", "Clovis", "Hobbs", "Alamogordo", "Carlsbad", "Gallup", "Deming", "Los Lunas", "Chaparral", "Sunland Park", "Los Alamos", "Portales", "Lovington", "Silver City", "Artesia"],
|
1315 |
+
"New York": ["New York City", "Buffalo", "Rochester", "Yonkers", "Syracuse", "Albany", "New Rochelle", "Mount Vernon", "Schenectady", "Utica", "White Plains", "Hempstead", "Troy", "Niagara Falls", "Binghamton", "Freeport", "Valley Stream", "Long Beach", "Rome", "North Tonawanda"],
|
1316 |
+
"North Carolina": ["Charlotte", "Raleigh", "Greensboro", "Durham", "Winston-Salem", "Fayetteville", "Cary", "Wilmington", "High Point", "Greenville", "Asheville", "Concord", "Gastonia", "Jacksonville", "Chapel Hill", "Rocky Mount", "Burlington", "Wilson", "Huntersville", "Kannapolis"],
|
1317 |
+
"North Dakota": ["Fargo", "Bismarck", "Grand Forks", "Minot", "West Fargo", "Williston", "Dickinson", "Mandan", "Jamestown", "Wahpeton", "Devils Lake", "Valley City", "Watford City", "Grafton", "Lincoln", "Beulah", "Rugby", "Stanley", "Horace", "Casselton"],
|
1318 |
+
"Ohio": ["Columbus", "Cleveland", "Cincinnati", "Toledo", "Akron", "Dayton", "Parma", "Canton", "Youngstown", "Lorain", "Hamilton", "Springfield", "Kettering", "Elyria", "Lakewood", "Cuyahoga Falls", "Middletown", "Euclid", "Mansfield", "Newark"],
|
1319 |
+
"Oklahoma": ["Oklahoma City", "Tulsa", "Norman", "Broken Arrow", "Lawton", "Edmond", "Moore", "Midwest City", "Enid", "Stillwater", "Muskogee", "Bartlesville", "Owasso", "Shawnee", "Ponca City", "Ardmore", "Duncan", "Del City", "Bixby", "Sapulpa"],
|
1320 |
+
"Oregon": ["Portland", "Salem", "Eugene", "Gresham", "Hillsboro", "Beaverton", "Bend", "Medford", "Springfield", "Corvallis", "Albany", "Tigard", "Lake Oswego", "Keizer", "Grants Pass", "Oregon City", "McMinnville", "Redmond", "Tualatin", "West Linn"],
|
1321 |
+
"Pennsylvania": ["Philadelphia", "Pittsburgh", "Allentown", "Erie", "Reading", "Scranton", "Bethlehem", "Lancaster", "Harrisburg", "Altoona", "York", "State College", "Wilkes-Barre", "Chester", "Williamsport", "Easton", "Lebanon", "Hazleton", "New Castle", "Johnstown"],
|
1322 |
+
"Rhode Island": ["Providence", "Warwick", "Cranston", "Pawtucket", "East Providence", "Woonsocket", "Coventry", "Cumberland", "North Providence", "South Kingstown", "West Warwick", "Johnston", "North Kingstown", "Newport", "Bristol", "Westerly", "Smithfield", "Lincoln", "Central Falls", "Portsmouth"],
|
1323 |
+
"South Carolina": ["Columbia", "Charleston", "North Charleston", "Mount Pleasant", "Rock Hill", "Greenville", "Summerville", "Sumter", "Hilton Head Island", "Florence", "Spartanburg", "Goose Creek", "Aiken", "Myrtle Beach", "Anderson", "Greer", "Mauldin", "Greenwood", "North Augusta", "Easley"],
|
1324 |
+
"South Dakota": ["Sioux Falls", "Rapid City", "Aberdeen", "Brookings", "Watertown", "Mitchell", "Yankton", "Pierre", "Huron", "Vermillion", "Spearfish", "Brandon", "Box Elder", "Madison", "Sturgis", "Belle Fourche", "Turns", "Dell Rapids", "Mobridge", "Milbank"],
|
1325 |
+
"Tennessee": ["Nashville", "Memphis", "Knoxville", "Chattanooga", "Clarksville", "Murfreesboro", "Franklin", "Jackson", "Johnson City", "Bartlett", "Hendersonville", "Kingsport", "Collierville", "Cleveland", "Smyrna", "Germantown", "Brentwood", "Columbia", "La Vergne", "Spring Hill"],
|
1326 |
+
"Texas": ["Houston", "San Antonio", "Dallas", "Austin", "Fort Worth", "El Paso", "Arlington", "Corpus Christi", "Plano", "Laredo", "Lubbock", "Garland", "Irving", "Amarillo", "Grand Prairie", "McKinney", "Frisco", "Brownsville", "Pasadena", "Mesquite"],
|
1327 |
+
"Utah": ["Salt Lake City", "West Valley City", "Provo", "West Jordan", "Orem", "Sandy", "Ogden", "St. George", "Layton", "Taylorsville", "South Jordan", "Lehi", "Logan", "Murray", "Draper", "Bountiful", "Riverton", "Roy", "Spanish Fork", "Pleasant Grove"],
|
1328 |
+
"Vermont": ["Burlington", "South Burlington", "Rutland", "Essex Junction", "Bennington", "Brattleboro", "Colchester", "Hartford", "Milton", "Barre", "Winooski", "St. Albans", "Montpelier", "Middlebury", "St. Johnsbury", "Swanton", "Springfield", "Morristown", "Williston", "Newport"],
|
1329 |
+
"Virginia": ["Virginia Beach", "Norfolk", "Chesapeake", "Richmond", "Newport News", "Alexandria", "Hampton", "Roanoke", "Portsmouth", "Suffolk", "Lynchburg", "Harrisonburg", "Leesburg", "Charlottesville", "Danville", "Blacksburg", "Manassas", "Petersburg", "Winchester", "Salem"],
|
1330 |
+
"Washington": ["Seattle", "Spokane", "Tacoma", "Vancouver", "Bellevue", "Kent", "Everett", "Renton", "Yakima", "Federal Way", "Spokane Valley", "Bellingham", "Kennewick", "Auburn", "Pasco", "Marysville", "Lakewood", "Redmond", "Shoreline", "Richland"],
|
1331 |
+
"West Virginia": ["Charleston", "Huntington", "Morgantown", "Parkersburg", "Wheeling", "Weirton", "Fairmont", "Martinsburg", "Beckley", "Clarksburg", "South Charleston", "St. Albans", "Vienna", "Bluefield", "Dunbar", "Elkins", "Bridgeport", "Nitro", "Hurricane", "Buckhannon"],
|
1332 |
+
"Wisconsin": ["Milwaukee", "Madison", "Green Bay", "Kenosha", "Racine", "Appleton", "Waukesha", "Oshkosh", "Eau Claire", "Janesville", "West Allis", "La Crosse", "Sheboygan", "Wauwatosa", "Fond du Lac", "New Berlin", "Wausau", "Brookfield", "Beloit", "Greenfield"],
|
1333 |
+
"Wyoming": ["Cheyenne", "Casper", "Laramie", "Gillette", "Rock Springs", "Sheridan", "Green River", "Evanston", "Riverton", "Jackson", "Cody", "Rawlins", "Lander", "Torrington", "Powell", "Douglas", "Worland", "Buffalo", "Wheatland", "Newcastle"],
|
1334 |
+
"Washington, DC": ["Washington"]
|
1335 |
+
}
|
1336 |
+
def find_lawyers(practice_area, state, city=None):
|
1337 |
+
base_url = "https://www.justia.com/lawyers"
|
1338 |
+
formatted_practice_area = format_url_component(practice_area)
|
1339 |
+
formatted_state = format_url_component(state)
|
1340 |
+
|
1341 |
+
if city:
|
1342 |
+
formatted_city = format_url_component(city)
|
1343 |
+
search_url = f"{base_url}/{formatted_practice_area}/{formatted_state}/{formatted_city}"
|
1344 |
+
else:
|
1345 |
+
search_url = f"{base_url}/{formatted_practice_area}/{formatted_state}"
|
1346 |
+
|
1347 |
+
response = requests.get(search_url)
|
1348 |
+
soup = BeautifulSoup(response.content, 'html.parser')
|
1349 |
+
|
1350 |
+
lawyers = []
|
1351 |
+
lawyer_cards = soup.find_all('div', class_='lawyer-card')
|
1352 |
+
|
1353 |
+
for card in lawyer_cards[:5]: # Limit to top 5 results
|
1354 |
+
name = card.find('h3', class_='lawyer-name').text.strip()
|
1355 |
+
location = card.find('div', class_='lawyer-location').text.strip()
|
1356 |
+
practice_areas = card.find('div', class_='lawyer-practice-areas').text.strip()
|
1357 |
+
profile_url = card.find('a', class_='lawyer-name')['href']
|
1358 |
+
|
1359 |
+
phone_elem = card.find('div', class_='lawyer-phone')
|
1360 |
+
phone = phone_elem.text.strip() if phone_elem else "N/A"
|
1361 |
+
|
1362 |
+
rating_elem = card.find('div', class_='lawyer-rating')
|
1363 |
+
rating = rating_elem.text.strip() if rating_elem else "N/A"
|
1364 |
+
|
1365 |
+
lawyers.append({
|
1366 |
+
'name': name,
|
1367 |
+
'location': location,
|
1368 |
+
'practice_areas': practice_areas,
|
1369 |
+
'phone': phone,
|
1370 |
+
'rating': rating,
|
1371 |
+
'profile_url': profile_url
|
1372 |
+
})
|
1373 |
+
|
1374 |
+
return lawyers
|
1375 |
+
|
1376 |
+
def format_url_component(s):
|
1377 |
+
return s.lower().replace(' ', '-').replace(',', '').replace('&', 'and')
|
1378 |
+
|
1379 |
+
def lawyer_finder_ui():
|
1380 |
+
st.subheader("Find the Best Lawyer for Your Case")
|
1381 |
+
|
1382 |
+
practice_area = st.selectbox("Select a Practice Area:", PRACTICE_AREAS)
|
1383 |
+
state = st.selectbox("Select a State:", STATES)
|
1384 |
+
|
1385 |
+
cities = CITIES_BY_STATE.get(state, [])
|
1386 |
+
if cities:
|
1387 |
+
city = st.selectbox("Select a City (optional):", [""] + cities)
|
1388 |
+
else:
|
1389 |
+
city = None
|
1390 |
+
st.info("No major cities available for the selected state. The search will be performed statewide.")
|
1391 |
+
|
1392 |
+
if st.button("Find Lawyers", type="primary"):
|
1393 |
+
with st.spinner("Searching for the best lawyers..."):
|
1394 |
+
lawyers = find_lawyers(practice_area, state, city)
|
1395 |
+
|
1396 |
+
if lawyers:
|
1397 |
+
st.success(f"Found {len(lawyers)} potential lawyers for your case.")
|
1398 |
+
for lawyer in lawyers:
|
1399 |
+
with st.expander(f"{lawyer['name']} - {lawyer['location']}"):
|
1400 |
+
col1, col2 = st.columns([2, 1])
|
1401 |
+
with col1:
|
1402 |
+
st.markdown(f"**Practice Areas:** {lawyer['practice_areas']}")
|
1403 |
+
st.markdown(f"**Phone:** {lawyer['phone']}")
|
1404 |
+
st.markdown(f"**Rating:** {lawyer['rating']}")
|
1405 |
+
with col2:
|
1406 |
+
st.markdown(f"[]({lawyer['profile_url']})")
|
1407 |
+
else:
|
1408 |
+
st.warning("No lawyers found matching your criteria. Try broadening your search.")
|
1409 |
+
|
1410 |
class LegalDataRetriever:
|
1411 |
def __init__(self):
|
1412 |
self.session = requests.Session()
|
|
|
1762 |
|
1763 |
feature = st.selectbox(
|
1764 |
"Select a feature",
|
1765 |
+
["Legal Chatbot", "Document Analysis", "Case Precedent Finder", "Legal Cost Estimator", "Contract Analysis", "Case Trend Visualizer", "Case Information Retrieval", "Automated Legal Brief Generation", "Find a Lawyer"]
|
1766 |
)
|
1767 |
if feature == "Legal Chatbot":
|
1768 |
st.subheader("Legal Chatbot")
|
|
|
1923 |
|
1924 |
elif feature == "Automated Legal Brief Generation":
|
1925 |
automated_legal_brief_generation_ui()
|
1926 |
+
|
1927 |
+
elif feature == "Find a Lawyer":
|
1928 |
+
lawyer_finder_ui()
|
1929 |
st.markdown("---")
|
1930 |
st.markdown(
|
1931 |
"""
|