this存储库

我尝试执行命令。

./PersonalityRecognizer -i ../output_dir -d -t 2 -a ../mairesse_Apache.arff


但是,我收到此错误。

C:/weka/weka-3-4/weka.jar: line 1: $'PK\003\004': command not found
C:/weka/weka-3-4/weka.jar: line 2: syntax error near unexpected token `('
C:/weka/weka-3-4/weka.jar: line 2: `▒=1 META-INF/▒=1META-INF/MANIFEST.MF▒M▒▒LK-.▒K-*▒▒ϳR0▒3▒▒M▒▒▒u▒I,.▒R(O▒N▒K/▒▒s▒t▒▒▒/N-▒r.JM,IM▒u▒▒Rp▒+▒1▒3▒▒P▒׀NMPK'
./PersonalityRecognizer: line 15: : command not found


我已经下载了weka jar文件,并按照说明的要求在以下文件中提供了路径:

#! /bin/bash -

# ENVIRONMENT VARIABLES

JDK_PATH=../../apps/jdk1.5.0_05
WEKA=../../apps/weka-3-4/weka.jar

# ----------------------------------

COMMONS_CLI=./lib/commons-cli-1.0.jar
MRC=./lib/jmrc.jar

LIBS=.:$WEKA:$COMMONS_CLI:$MRC:bin/

$JDK_PATH/bin/java -Xmx512m -classpath $LIBS recognizer.PersonalityRecognizer $*

最佳答案

正如jhenrique所说,如果您使用Windows,则必须编辑PersonalityRecognizer.bat(您似乎已经编辑了bash脚本,但在Windows上运行)。

然后,您必须确保目录结构如下所示:

  \ Personality-Recognition-in-SD-master (this is the cloned repo's root)
    +---apps
    +---Classification
    +---data
    +---mrc
    +---output_dir
    \---PersonalityRecognizer (this contains the PersonalityRecognizer.bat and bash scripts, note the subdirectory)


您还必须确保在PersonalityRecognizer子目录中编辑PersonalityRecognizer.properties,以包括您的应用程序路径。如果使用Windows,则必须使用double /作为路径分隔符:

##################################################
# Configuration File of the Personality Recognizer
##################################################

# All variables should be modified according to your
# directory structure

# Warning: for Windows paths, backslashes need to be
# doubled, e.g. c:\\Program Files\\Recognizer

# Root directory of the application
appDir = F:\\Personality-Recognition-in-SD-master\\PersonalityRecognizer

# Path to the LIWC dictionary file (LIWC.CAT)
liwcCatFile = lib/LIWC.CAT

# Path to the MRC Psycholinguistic Database file (mrc2.dct)
mrcPath = ../mrc/mrc2.dct


更新:
还请确保PersonalityRecognizer.bat中的JDK_PATH和WEKA变量指向有效的JDK路径和WEKA路径(weka.jar包含在您克隆的存储库中):

@echo off
rem WINDOWS LAUNCH SCRIPT

rem ENVIRONMENT VARIABLES TO MODIFY

set JDK_PATH="C:\Program Files\Java\jdk1.6.0_01"
set WEKA="F:\Personality-Recognition-in-SD-master\apps\weka-3-4\weka.jar"

rem ----------------------------------

set COMMONS_CLI="lib\commons-cli-1.0.jar"
set JMRC="lib\jmrc.jar"

set LIBS=%WEKA%;%COMMONS_CLI%;%JMRC%;%CD%;bin\

%JDK_PATH%\bin\java -Xmx512m -classpath %LIBS% recognizer.PersonalityRecognizer %1 %2 %3 %4 %5 %6 %7 %8 %9

09-09 22:46