Skip to content

Commit

Permalink
- Deprecated Legacy KeywordExtractor
Browse files Browse the repository at this point in the history
- Enroll Primary New KeywordExtractor
  • Loading branch information
K-Diger committed Mar 22, 2024
1 parent 7f4e6be commit 968197a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.mashup.shorts.core.modern
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter.ofPattern
import org.jsoup.select.Elements
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.context.annotation.Primary
import org.springframework.stereotype.Component
import com.mashup.shorts.KeywordExtractor
Expand Down Expand Up @@ -37,7 +36,7 @@ class CrawlerCore(
private val newsRepository: NewsRepository,
private val newsBulkInsertRepository: NewsBulkInsertRepository,
private val newsCardBulkInsertRepository: NewsCardBulkInsertRepository,
@Qualifier("LuceneAnalyzerKeywordExtractorV2") private val keywordExtractor: KeywordExtractor,
private val keywordExtractor: KeywordExtractor,
private val rankingGenerator: RankingGenerator,
) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import org.apache.lucene.analysis.TokenStream
import org.apache.lucene.analysis.ko.KoreanTokenizer
import org.apache.lucene.analysis.ko.KoreanTokenizer.DecompoundMode
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.stereotype.Component
import com.mashup.shorts.KeywordExtractor
import com.mashup.shorts.consts.stopWords
import com.mashup.shorts.consts.CONTENT_WEIGHT
import com.mashup.shorts.consts.TITLE_WEIGHT
import com.mashup.shorts.consts.stopWords

@Component
@Qualifier("LuceneAnalyzerKeywordExtractor")
@Deprecated("Deprecated By BM25 KeywordExtractor")
class LuceneAnalyzerKeywordExtractor : KeywordExtractor {

override fun extractKeyword(title: String, content: String): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import org.apache.lucene.analysis.TokenStream
import org.apache.lucene.analysis.ko.KoreanTokenizer
import org.apache.lucene.analysis.ko.KoreanTokenizer.DecompoundMode
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.context.annotation.Primary
import org.springframework.stereotype.Component
import com.mashup.shorts.KeywordExtractor
import com.mashup.shorts.consts.stopWords

@Primary
@Component
@Qualifier("LuceneAnalyzerKeywordExtractorV2")
class LuceneAnalyzerKeywordExtractorV2 : KeywordExtractor {

/* 변수 `k1`에 대한 부연 설명 By K-Diger
Expand Down

0 comments on commit 968197a

Please sign in to comment.