DS20
Q. 1) create a student.xml file containing at least 5 student information [Marks 15]
<?xml version="1.0" encoding="UTF-8"?> <Students> <Student> <RollNo>101</RollNo> <Name>John Doe</Name> <Age>20</Age> <Grade>A</Grade> </Student> <Student> <RollNo>102</RollNo> <Name>Jane Smith</Name> <Age>22</Age> <Grade>B</Grade> </Student> <Student> <RollNo>103</RollNo> <Name>Alice Johnson</Name> <Age>21</Age> <Grade>A</Grade> </Student> <Student> <RollNo>104</RollNo> <Name>Bob Brown</Name> <Age>23</Age> <Grade>C</Grade> </Student> <Student> <RollNo>105</RollNo> <Name>Eve Wilson</Name> <Age>19</Age> <Grade>B</Grade> </Student> </Students>Q. 2)Consider text paragraph."""Hello all, Welcome to Python Programming Academy. Python
Programming Academy is a nice platform to learn new programming skills. It is difficult to get enrolled
in this Academy."""Remove the stopwords
import nltk
from nltk.corpus import stopwords
nltk.download('stopwords')
Given text paragraph
text = """Hello all, Welcome to Python Programming Academy. Python Programming Academy is a nice platform to learn new programming skills. It is difficult to get enrolled in this Academy."""
Tokenize the text into words
words = nltk.word_tokenize(text)
Remove stopwords
filtered_words = [word for word in words if word.lower() not in stopwords.words('english')]
Join the filtered words back into a paragraph
filtered_text = ' '.join(filtered_words)
print("Original Text:")
print(text)
print("\nText after removing stopwords:")
print(filtered_text)