p1 = '''
Electronic commerce, commonly written as E-Commerce, is the trading or
facilitation of trading in goods or services using computer networks, such
as the Internet or online social networks. Electronic commerce draws on
technologies such as mobile commerce, electronic funds transfer, supply
chain management, Internet marketing, online transaction processing,
electronic data interchange (EDI), inventory management systems, and
automated data collection systems.
'''.split()
p2 = '''
Modern electronic commerce typically uses the World Wide Web for at least
one part of the transaction's life cycle although it may also use other
technologies such as e-mail. The benefits of e-commerce include it’s the
speed of access, a wider selection of goods and services, accessibility, and
international reach.
'''.split()
print(set(p1).intersection(p2))
{'and', 'the', 'technologies', 'of', 'electronic', 'such', 'commerce', 'as', 'goods'}
您可以使用set.intersection。你知道吗
如果您不需要在语言处理方面做一些特殊的事情,那么您就不需要NLTK:
相关问题 更多 >
编程相关推荐