我想在我的Google Colab笔记本中使用Stanford CoreNLP。为此,我需要Java。有没有办法在这些机器上安装Java?
我目前拥有的是:
!pip install StanfordCoreNLP
from stanfordcorenlp import StanfordCoreNLP
nlp = StanfordCoreNLP('stanford-corenlp', lang='de', memory='4g')
...
nlp.close()
Run Code Online (Sandbox Code Playgroud)
我得到错误:
FileNotFoundError: [Errno 2] No such file or directory: 'java': 'java'
Run Code Online (Sandbox Code Playgroud) 我的代码基于sklearn网站上的示例:https ://scikit-learn.org/stable/auto_examples/model_selection/plot_nested_cross_validation_iris.html
\n我正在尝试在内部和外部简历中使用 GroupKFold。
\nfrom sklearn.datasets import load_iris\nfrom matplotlib import pyplot as plt\nfrom sklearn.svm import SVC\nfrom sklearn.model_selection import GridSearchCV, cross_val_score, KFold,GroupKFold\nimport numpy as np\n\n# Load the dataset\niris = load_iris()\nX_iris = iris.data\ny_iris = iris.target\n\n# Set up possible values of parameters to optimize over\np_grid = {"C": [1, 10, 100],\n "gamma": [.01, .1]}\n\n# We will use a Support Vector Classifier with "rbf" kernel\nsvm = SVC(kernel="rbf")\n\n# Choose cross-validation techniques for the inner and outer loops,\n# independently of the dataset.\n# E.g "GroupKFold", …Run Code Online (Sandbox Code Playgroud)