XufengDuan commited on
Commit
88e393c
1 Parent(s): 05052dc

update scripts

Browse files
.idea/workspace.xml CHANGED
@@ -12,6 +12,9 @@
12
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
13
  <option name="LAST_RESOLUTION" value="IGNORE" />
14
  </component>
 
 
 
15
  <component name="PropertiesComponent"><![CDATA[{
16
  "keyToString": {
17
  "Python.model_operations.executor": "Run",
@@ -24,7 +27,7 @@
24
  </component>
25
  <component name="com.intellij.coverage.CoverageDataManagerImpl">
26
  <SUITE FILE_PATH="coverage/HumanLikeness$.coverage" NAME=" Coverage Results" MODIFIED="1723441364832" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/tests" />
27
- <SUITE FILE_PATH="coverage/HumanLikeness$model_operations.coverage" NAME="model_operations Coverage Results" MODIFIED="1723538502255" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src/backend" />
28
  <SUITE FILE_PATH="coverage/HumanLikeness$app.coverage" NAME="app Coverage Results" MODIFIED="1723380005800" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
29
  <SUITE FILE_PATH="coverage/HumanLikeness$main_backend.coverage" NAME="main_backend Coverage Results" MODIFIED="1723534420423" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
30
  <SUITE FILE_PATH="coverage/HumanLikeness$evaluate_humanlike.coverage" NAME="evaluate_humanlike Coverage Results" MODIFIED="1723398170634" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/../Library/Containers/com.tencent.xinWeChat/Data/Library/Application Support/com.tencent.xinWeChat/2.0b4.0.9/32b9ff35361847f45b1e7909fcdff84c/Message/MessageTemp/7420e97876942c1eea73293c47ebb239/OpenData" />
 
12
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
13
  <option name="LAST_RESOLUTION" value="IGNORE" />
14
  </component>
15
+ <component name="ProblemsViewState">
16
+ <option name="selectedTabId" value="QODANA_PROBLEMS_VIEW_TAB" />
17
+ </component>
18
  <component name="PropertiesComponent"><![CDATA[{
19
  "keyToString": {
20
  "Python.model_operations.executor": "Run",
 
27
  </component>
28
  <component name="com.intellij.coverage.CoverageDataManagerImpl">
29
  <SUITE FILE_PATH="coverage/HumanLikeness$.coverage" NAME=" Coverage Results" MODIFIED="1723441364832" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/tests" />
30
+ <SUITE FILE_PATH="coverage/HumanLikeness$model_operations.coverage" NAME="model_operations Coverage Results" MODIFIED="1723539909992" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src/backend" />
31
  <SUITE FILE_PATH="coverage/HumanLikeness$app.coverage" NAME="app Coverage Results" MODIFIED="1723380005800" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
32
  <SUITE FILE_PATH="coverage/HumanLikeness$main_backend.coverage" NAME="main_backend Coverage Results" MODIFIED="1723534420423" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
33
  <SUITE FILE_PATH="coverage/HumanLikeness$evaluate_humanlike.coverage" NAME="evaluate_humanlike Coverage Results" MODIFIED="1723398170634" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/../Library/Containers/com.tencent.xinWeChat/Data/Library/Application Support/com.tencent.xinWeChat/2.0b4.0.9/32b9ff35361847f45b1e7909fcdff84c/Message/MessageTemp/7420e97876942c1eea73293c47ebb239/OpenData" />
src/backend/model_operations.py CHANGED
@@ -41,9 +41,9 @@ subprocess.run(["pip", "install", "curated-transformers==0.1.1"], check=True)
41
  # Load spacy model for word tokenization
42
  # nlp = spacy.load("en_core_web_sm")
43
  try:
44
- nlp1 = spacy.load("en_core_web_trf")
45
  except OSError:
46
- pass
47
 
48
  # litellm.set_verbose=False
49
  litellm.set_verbose=True
@@ -521,7 +521,7 @@ class SummaryGenerator:
521
 
522
  for summary in self.summaries_df['summary']:
523
  if util.is_summary_valid(summary):
524
- doc = nlp(summary)
525
  words = [token.text for token in doc if token.is_alpha]
526
  total_word_count += len(words)
527
  total_count += 1
 
41
  # Load spacy model for word tokenization
42
  # nlp = spacy.load("en_core_web_sm")
43
  try:
44
+ nlp1 = spacy.load("en_core_web_sm")
45
  except OSError:
46
+ print("无法加载模型,继续执行其他处理。")
47
 
48
  # litellm.set_verbose=False
49
  litellm.set_verbose=True
 
521
 
522
  for summary in self.summaries_df['summary']:
523
  if util.is_summary_valid(summary):
524
+ doc = nlp1(summary)
525
  words = [token.text for token in doc if token.is_alpha]
526
  total_word_count += len(words)
527
  total_count += 1