NLP301c_-_SU_2024_-_PE1_2632.webp
hoangnam84

NLP301c_-_SU_2024_-_PE1_2632.webp

Write a Python program that takes a document as input and outputs a list of the named entities (people, organizations, locations) in the document.
Hint: This requires using a named entity recognition library like spaCy.
Example:
Input:
A document: "Apple Inc. is an American multinational technology company. Its headquarters are in Cupertino, California."
Output:
[('Apple Inc.', 'ORG'), ('American', 'NORP'), ('Cupertino', 'GPE'),('California','GPE')]
Question 4: (3 marks)
Write a Python program that takes a sentence as input and outputs a new sentence where all the words are sorted alphabetically.
Input:A sentence: "the quick brown fox jumps over the lazy dog"
Output:"brown dog fox jumps lazy over quick the the"
2
Zoom

+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
NLP301c
Thêm bởi
hoangnam84
Ngày thêm
Lượt xem
2,444
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
NLP301c_-_SU_2024_-_PE1_2632.webp
File size
73.9 KB
Dimensions
1920px x 803px

Share this media

Back
Bên trên Bottom