Substring match within a text for given keywords
Unnecessary parentheses
Switch the following:
return(...) -&gt; return ...
if(...) -&gt; if ...

You switch between the two, probably due to coming from another language. Just try to be consistent and don't use parentheses if you don't have to.
Type Hints
You can use type hints to display what types of parameters are accepted, and what types of values are returned, if any.
def fuzzy_extract(query_string: str, match_string: str, threshold: int, max_dist: int):
def get_match(text: str, keywords: List[str], threshold: int):

The List is imported by from typing import List
Simplify your loops
Instead of checking if len(li) &gt; = 0, you can do that check inside the list comprehension. Also, I would move that outside of the loop into its own variable.
extracted = [fuzzy_extract(query_string, text, 0, 1) for query_string in keywords if len(query_string) &gt; 0]

Empty lists
Instead of checking if the length of the list is 0, simply check if the list is None. An empty list is implicitly None.
if not candidates:

Default Parameters
When passing default parameters, there shouldn't be a space before or after the =.
for word, _ in process.extractBests(query_string, (match_string,), score_cutoff=threshold):
        for match in find_near_matches(query_string, word, max_l_dist=max_dist):

Final Code
from fuzzywuzzy import process
from fuzzysearch import find_near_matches
import math

from typing import List

def fuzzy_extract(query_string: str, match_string: str, threshold: int, max_dist: int):
    matches = []
    for word, _ in process.extractBests(query_string, (match_string,), score_cutoff=threshold):
        for match in find_near_matches(query_string, word, max_l_dist=max_dist):
            word = word[match.start:match.end]
            matches.append({&quot;kw&quot;: query_string, &quot;word&quot;: word, &quot;dist&quot;: match.dist})
    return matches

def get_match(text: str, keywords: List[str], threshold: int):
    keywords = [keyword.lower() for keyword in keywords]
    text = text.lower()

    canidates = []
    extracted = [fuzzy_extract(query_string, text, 0, 1) for query_string in keywords if len(query_string) &gt; 0]
    for item in extracted:
        for di in item:
            if di[&quot;dist&quot;] &lt;= math.ceil(len(di[&quot;word&quot;]) / threshold):
                canidates.append(di)

    if not canidates:
        return []

    result = str(canidates[0][&quot;kw&quot;])
    return result

keywords = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;]
text = &quot;nana is Looking for an aple.&quot;

print(get_match(text, keywords, 10))