Code Monkey home page Code Monkey logo

Comments (2)

michalkordyzon avatar michalkordyzon commented on August 11, 2024

full error message:
`File ~/_dev/assistant-skill-analysis-master/assistant_skill_analysis/term_analysis/keyword_analyzer.py:104, in seaborn_heatmap(workspace_df, lang_util, label_for_display, max_token_display, class_list)
94 def seaborn_heatmap(
95 workspace_df, lang_util, label_for_display=30, max_token_display=30, class_list=None
96 ):
97 """
98 Create heat map of word frequencies per intent
99 :param workspace_df:
(...)
102 :param class_list:
103 """
--> 104 counts, top_counts = _preprocess_for_heat_map(
105 workspace_df, lang_util, label_for_display, max_token_display, class_list
106 )
107 reset_groupby = counts.reset_index()
108 most_frequent_words = top_counts.reset_index()["word"].unique()

File ~/_dev/assistant-skill-analysis-master/assistant_skill_analysis/term_analysis/keyword_analyzer.py:44, in _preprocess_for_heat_map(workspace_df, lang_util, label_for_display, max_token_display, class_list)
37 counts = _get_counts_per_label(
38 workspace_df, lang_util=lang_util, unigrams_col_name="unigrams"
39 )
41 max_n = int(
42 np.ceil(max_token_display / len(counts.index.get_level_values(0).unique()))
43 )
---> 44 top_counts = _get_top_n(counts["n_w"], top_n=max_n)
45 return counts, top_counts

File ~/anaconda3/envs/wa/lib/python3.10/site-packages/pandas/core/frame.py:3761, in DataFrame.getitem(self, key)
3759 if self.columns.nlevels > 1:
3760 return self._getitem_multilevel(key)
-> 3761 indexer = self.columns.get_loc(key)
3762 if is_integer(indexer):
3763 indexer = [indexer]

File ~/anaconda3/envs/wa/lib/python3.10/site-packages/pandas/core/indexes/base.py:3655, in Index.get_loc(self, key)
3653 return self._engine.get_loc(casted_key)
3654 except KeyError as err:
-> 3655 raise KeyError(key) from err
3656 except TypeError:
3657 # If we have a listlike key, _check_indexing_error will raise
3658 # InvalidIndexError. Otherwise we fall through and re-raise
3659 # the TypeError.
3660 self._check_indexing_error(key)

KeyError: 'n_w'`

from assistant-skill-analysis.

haodeqi avatar haodeqi commented on August 11, 2024

hi @michalkordyzon , this should be fixed in the latest version.

from assistant-skill-analysis.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.