NLP301c_-_SU_2024_-_PE1_2632.webp
hoangnam84

NLP301c_-_SU_2024_-_PE1_2632.webp

Write a Python program that takes a sentence as input and outputs a list of the words in the sentence.
Input:A sentence: "The quick brown fox jumps over the lazy dog"
Desired Output:
['The', 'quick', 'brown', 'fox', 'jumps'jumps', 'over', 'the', 'lazy', 'dog']
Question 2: (2 marks)
Write a Python program that inputs a text file and outputs a new file where all the words are converted to lowercase.
Input:
A text file named "upper.txt" with the following content:THIS IS A SAMPLE TEXT FILE.ALL LETTERS ARE UPPERCASE.
Desired Output:
A new file named "lower.txt" with the following content:this is a sample text file.
all letters are lowercase.
Question 3: (3 marks)
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 snaCv

Close
+ 100%
Zoom
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
3,626
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
80.6 KB
Dimensions
1920px x 803px

Share this media

Back
Bên trên Bottom