Skip to main content
. 2025 Sep 16;27(9):961. doi: 10.3390/e27090961
Algorithm 2 SE-KIA (online component)
  •   1:

    Input: User query q={k1,k2,,kn}, keyword co-occurrence word graph G=(V,E), weight factor weight=2, POS weight table W

  •   2:

    Output: Keyword weights {w1,w2,,wn}

  •   3:

    Step 1: Static Weight Assignment

  •   4:

    for each keyword kiq do

  •   5:

       Retrieve part-of-speech tag POS(ki)

  •   6:

       Assign static weight: wiW[POS(ki)]

  •   7:

    end for

  •   8:

    Step 2: Dynamic Weight Adjustment

  •   9:

    Generate candidate pairs: P{(ki,kj)1i<jn}

  • 10:

    for each pair (ki,kj)P do

  • 11:

       if (ki,kj) exists in G then

  • 12:

          Retrieve precomputed relative importance wijG.get_importance(ki,kj)

  • 13:

          if wij=1 and wi<wj then

  • 14:

              wi=wj+weight

  • 15:

          else if wij=1 and wi>wj then

  • 16:

              wj=wi+weight

  • 17:

          end if

  • 18:

       end if

  • 19:

    end for

  • 20:

    Step 3: New Queries Logging

  • 21:

    Insert q into log database L

  • 22:

    Periodically (e.g., daily): extract new pairs P˜ from L with frequency fijτ

  • 23:

    Update G with P˜

  • 24:

    return{w1,w2,,wn}