Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,8 +21,8 @@ def my_custom_tool(sentence:str)-> str: #it's import to specify the return type
|
|
| 21 |
doc = nlp(sentence)
|
| 22 |
|
| 23 |
for token in doc:
|
| 24 |
-
|
| 25 |
-
|
| 26 |
|
| 27 |
|
| 28 |
@tool
|
|
|
|
| 21 |
doc = nlp(sentence)
|
| 22 |
|
| 23 |
for token in doc:
|
| 24 |
+
if token.dep_ in ("nsubj", "nsubjpass"):
|
| 25 |
+
return f"Subject: {token.text}"
|
| 26 |
|
| 27 |
|
| 28 |
@tool
|