使用Python包spaCy,如何检测一个句子是使用被动语态还是主动语态?例如,以下句子应分别检测为使用被动语态和主动语态:
passive_sentence = "John was accused of committing crimes by David"
# passive voice "John was accused"
active_sentence = "David accused John of committing crimes"
# active voice "David accused John"
Run Code Online (Sandbox Code Playgroud)