fix(3-1): 更新 stopwords.txt 文件路径

- 将 HDFS 文件路径从相对路径改为绝对路径
- 新路径为 "hdfs://master:9000/user/root/stopwords.txt"
- 此修改提高了文件访问的准确性和可靠性
This commit is contained in:
fly6516 2025-04-16 09:44:12 +08:00
parent c699e3d21e
commit 4233cfc792

2
3-1.py
View File

@ -10,7 +10,7 @@ def tokenize(text):
def load_stopwords(sc):
try:
return set(sc.textFile("hdfs:///user/root/stopwords.txt").collect())
return set(sc.textFile("hdfs://master:9000/user/root/stopwords.txt").collect())
except:
# fallback to local
with open("stopwords.txt", "r") as f: